Orion-AI-Lab / S4A-Models

Various experiments on the Sen4AgriNet dataset
MIT License
30 stars 9 forks source link

how to test run the model #5

Open im-tanyasuri opened 2 years ago

im-tanyasuri commented 2 years ago

Hey, I have placed the required files like netcdf files, coco files as well as the checkpoint, but the visualize_predictions.py saves no output, can you please help with the right command to test the model. Thanks

paren8esis commented 2 years ago

Hello. Can you please provide the command you are using?

im-tanyasuri commented 2 years ago

Hello, Thanks for replying. Following is the command, I have been using:

python visualize_predictions.py --img_size 61 61 --model 'convlstm' --root_path_coco '/content/drive/MyDrive/cropClass/coco_files' --netcdf_path '/content/drive/MyDrive/cropClass/S4A' --load_checkpoint '/content/drive/MyDrive/cropClass/epoch=17-step=60749.ckpt' --prefix_coco 'exp1_patches5000_strat'

im-tanyasuri commented 2 years ago

I want output result with semantic segmentation masks .

paren8esis commented 2 years ago

We improved the script a little bit and fixed a bug on the netcdf path argument. Please be careful to provide all the necessary arguments for the specific model you are using. For example, our models were trained on 4-band input only, so you must also provide the argument --bands B02 B03 B04 B08.

Also, if you haven't precomputed the medians (by running the export_medians_multi.py script), the visualization may take a VERY LONG time to finish, since the medians for the corresponding netcdf are computed on the fly. If you did precompute the medians, though, you must provide the arguments --saved_medians and --prefix <medians_prefix> so the script will know where to find them.

Finally, a useful argument is --mask_parcels, which visualizes the predictions of the model for the parcel pixels only and discards the rest.

Please check if the script works for you now.