You can find a better description of each part of the code in the README inside each folder (pretrain, downstream, data_simulation, myriad_2)
-
To run the code, you should install this repo as a module in Python.
-
To install as module, run from the top directory of the repository (/phi2FM)
pip install -e . -
Now you are able to use
import pretrain,import downstream,import data_simulation -
You can also use deeper imports (e.f.
from downstream.models.phisatnet_downstream import PhiSatNetDownstream)
The folder data_simulation contains the scripts to simulate Φsat-2 data from L1C data. It contains:
phileo-bench: to simulate Φsat-2 data from PhilEO-Bench datasetpretraining: to download MajorTOM pretraining data and convert it to Φsat-2 datasimulator: contains the main logic for running the simulator (except the simulator workflow itself, which is described in eitherpretrainingorphileo-bench).tiff_to_np_patches: the other scripts create tiff files of Φsat-2 data of a big shape (e.g. 2048x2048). This folder divides these files into smaller.npypatches to feed into the model (e.g. 256x256).
Runs the pretraining. This folder is pretty easy to run, as it just requires to change the .yml file with your directories, and number of GPUs to use.
Run downstream experiments (right now only for PhilEO-Bench).
- If want to add new datasets, modify
load_data.py,data_protocol.pyandvisualize.py - If want to add new models, modify
modelsfolder, and add it to thetraining_script.py(the main file running everything).
Explains how to convert the model to OpenVINO 2020.3
- The conversion to ONNX should happen in the
downstreamfolder tho (seeconvert_to_onnxfunction underdownstream/utils/utils.py)