File size: 1,299 Bytes
abd2a81 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# Introduction
This "scripts" folder contains stand-alone scripts for some useful tasks detailed below.
## mask_to_json.py
Use this script to convert .png segmentation masks from the Open Solution from the CrowdAI challenge
(https://github.com/neptune-ai/open-solution-mapping-challenge)
to the COCO .json format with RLE mask encododing.
Run as:
```
mask_to_json.py --mask_dirpath <path to directory with the png masks> --output_filepath <path to the output .json COCO format annotation file>
```
## plot_framefield.py
Use this script to plot a framefield saved as a .npy file. Can be useful for visualization.
Explanation about its arguments can be accessed with:
```
mask_to_json.py --help
```
## ply_to_json.py
Use this script to convert .ply segmentation polygons from the paper
"Li, M., Lafarge, F., Marlet, R.: Approximating shapes in images with low-complexity polygons. In: CVPR (2020)"
to the COCO .json format with [polygon] mask encoding. In order to fill the score field of each annotation in the COCO format, we also need access to segmentation masks.
Run as
```
ply_to_json.py --ply_dirpath <path to directory with the .ply files> --mask_dirpath <path to directory with the probability masks> --output_filepath <path to the output .json COCO format annotation file>
``` |