Skip to content

Python scripts for performing Image Inpainting using the MST model in ONNX

License

Notifications You must be signed in to change notification settings

ibaiGorordo/ONNX-MST-Image-Inpainting

Repository files navigation

ONNX MST Image Inpainting

Python scripts for performing Image Inpainting using the MST model in ONNX

!ONNX MST Image Inpainting

Original image: https://es.wikipedia.org/wiki/Archivo:Perro_Pipper_en_Merida_-_Pipperontour.jpg

Requirements

  • Check the requirements.txt file.
  • For ONNX, if you have a NVIDIA GPU, then install the onnxruntime-gpu, otherwise use the onnxruntime library.

Installation

⚠️ Make sure to add the recursive when cloning

git clone https://github.com/ibaiGorordo/ONNX-MST-Image-Inpainting.git --recursive
cd ONNX-MST-Image-Inpainting
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

ONNX model

Convert the model to ONNX using the Colab repository below and save it into the models folder

  • Convert MST Inpainting to ONNX Open In Colab
  • The License of the models is MIT: License

Examples

  • Image Inpainting (mask already available):
python image_inpaint.py.py
  • Sketch mask and Inpaint:
python sketch_and_inpaint.py.py

!ONNX MST Image Inpainting with mask sketch

Mask Sketcher Usage

  • Left Mouse Button: Draw Mask
  • Middle/Wheel Mouse Button: Remove Mask
  • Bottom slider: Control mask drawing tool size
  • Press any key to stop sketching
inpaint.mp4

References:

About

Python scripts for performing Image Inpainting using the MST model in ONNX

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages