(Image from https://github.com/hkchengrex/CascadePSP/blob/master/segmentation-refinement/test/aeroplane.jpg)
(Image from https://github.com/hkchengrex/CascadePSP/blob/master/segmentation-refinement/test/aeroplane.png)
Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.
For the sample image,
$ python3 cascade_psp.py
If you want to specify the input image, put the image path after the --input
option.
You can use --savepath
option to change the name of the output file to save.
$ python3 cascade_psp.py --input IMAGE_PATH --savepath SAVE_IMAGE_PATH
This model requires a mask image.
You can specify the mask image by put the file path after the --mask_image
option.
$ python3 cascade_psp.py --input IMAGE_PATH --mask_image MASK_IMAGE_PATH
Use the `--generate_mask` option to automatically generate a mask image using u2net.
python3 cascade_psp.py --generate_mask -i input.jpg
Pytorch
ONNX opset=11