An example of EdgeConnect Model on iOS using CoreML.
EdgeConnect (https://github.com/knazeri/edge-connect) is a Generative Image Inpainting with Adversarial Edge Learning. https://arxiv.org/abs/1901.00212
- UI code: NSTDemo (https://github.com/kirualex/NSTDemo)
- CoreMLHelpers code: CoreMLHelpers (https://github.com/hollance/CoreMLHelpers)
- Canny Edge Detection: GPUImage2 (https://github.com/BradLarson/GPUImage2)
How to convert pytorch model to CoreML model:
- Run modified edge-connect code to remove spectral normalization and convert to ONNX model.
python test.py --checkpoints ./checkpoints/places2 --input ./examples/test/places2 --output ./results
Modify line 158 to change input resolution.
Modify checkpoint argument to use other pretrained weights. This example uses places2 weight.
- Run ONNX to CoreML converter on ONNX files to get CoreML models.
- Optimize Canny edge detection to get more accurate edge output.
- Apply mask from touch screen input.