# Inpaint Service

The Inpaint service takes an annotated image, erases the annotated features from the image, and generates a new image or a Blender file with placement areas where those annotated features were originally located. The generated Blender file can be used as a background image in channels that support placement of objects on 2D backgrounds such as SATRGB.

The Inpaint service is accessed from the Assets tab of the GUI.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2F35OWJoappANR8YIFqAZT%2Fimage.png?alt=media&#x26;token=849f6bdb-809b-446b-bd58-e4463ac60b91" alt=""><figcaption><p>Assets Tab</p></figcaption></figure>

The source backgrounds need to be uploaded to a Workspace Volume. Click on the workspace volume from the volume list. A page showing the volume content will be displayed.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2Fr8Q4sOmG7vFoB3Upuhui%2Fimage.png?alt=media&#x26;token=26bab4e0-6d71-410f-96ab-799b28fc79f2" alt=""><figcaption><p>Empty Volume Page</p></figcaption></figure>

The Inpaint service processes all images in a directory so it is a good idea to create a new folder to hold the source backgrounds and their annotation files or image masks. Click on the New Folder button and give the folder an appropriate name.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FbqJN3RO2pUH4urTsFu9r%2Fimage.png?alt=media&#x26;token=d36f2c92-438d-4947-a606-d1d4ba3ce57f" alt=""><figcaption><p>New Folder Dialog</p></figcaption></figure>

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FjbPfFt1h8sPxerOOW7LF%2Fimage.png?alt=media&#x26;token=0b720225-29f5-4248-83ca-305845b4b3f1" alt=""><figcaption><p>Backgrounds Folder</p></figcaption></figure>

Click on the **Backgrounds** working folder, then click the **Upload File** button. Add the background image along with the annotation files or mask images. The background image must be in **TIFF, PNG, JPG, or JPEG** format. Annotation files should be in one of the following formats: **COCO, KITTI, Pascal, YOLO, or GeoJSON**. Mask images must have a **.mask.png, .mask.jpg, .mask.jpeg, or .mask.tiff** extension.

Annotation files and mask images are not both required—only one is needed for all background images.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2F1itzIQjmxiXs52hLstB3%2Fimage.png?alt=media&#x26;token=bf33cdb6-31e7-4866-9d7c-614ea484f424" alt=""><figcaption><p>Upload File Dialog</p></figcaption></figure>

Click the Upload button to upload the files.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FnXv1YJztWPjsPYKNSejq%2Fimage.png?alt=media&#x26;token=5e96a1d3-8567-4964-8c99-cd81faae8f15" alt=""><figcaption><p>Uploaded Files</p></figcaption></figure>

To run the Inpaint service click on the Create button. This brings up the Create dialog.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FepBkEju2RYqmgQl81T75%2Fimage.png?alt=media&#x26;token=d92bf2f1-728f-4fc3-bf5d-c55e71d00862" alt=""><figcaption><p>Create Dialog</p></figcaption></figure>

Click on the Inpaint button to bring up the Inpaint dialog

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FckAnm2hFQcbhHG8GMNnm%2Fimage.png?alt=media&#x26;token=d3ea00b9-bf6c-4150-8088-59334de99e08" alt=""><figcaption><p>Inpaint dialog</p></figcaption></figure>

By default, the input location is set to the current directory, with the input type as **MASK**. The output will be stored in a subdirectory named **"cleaned"**, followed by a timestamp. The output format is **PNG**, and the dilation value is set to **5**. Dilation controls how much the mask area expands before inpainting the image.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FgOyPDRdBB0nzBgtoUhbB%2Fimage.png?alt=media&#x26;token=090e3a42-90ae-4caa-8a1f-88b1b72f1038" alt=""><figcaption><p>Input types</p></figcaption></figure>

Other available input types include **GEOJSON, COCO, KITTI, PASCAL,** and **YOLO**—choose the option that best fits your needs.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FqJwpfm5ahyzDqhHYQDxt%2Fimage.png?alt=media&#x26;token=df4c45a0-ea04-4755-b4cb-7627e21b7968" alt=""><figcaption></figcaption></figure>

Other available output types include **PNG, JPG,** and **SATRBG Background**—choose the option that best fits your needs.

Click the Create button to accept these and start the Inpaint  service. A "Create Jobs" window will pop up in the lower left. Click on the down arrow to see progress of the job.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FPAKnht9zne0rscRCm2Wd%2Fimage.png?alt=media&#x26;token=21589f95-6eb9-4e9b-a438-bf747a2dc2e1" alt=""><figcaption><p>Create Jobs Window</p></figcaption></figure>

When the job is complete, the hour glass icon will switch to a go to icon. Click on that icon and you will be switched to the output directory. There will be cleaned backgrounds for every background image that you processed.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2Fl38GWyluCXMWFm5fPfGO%2Fimage.png?alt=media&#x26;token=3157cb6f-50cc-4729-805e-56440d70c73f" alt=""><figcaption><p>Output dir</p></figcaption></figure>

Here are the original and cleaned background images.

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FHAQB5EuCPnfG4uwxW3uP%2Fimage.png?alt=media&#x26;token=dfa80055-5c46-4c36-8071-5bd0a9d02392" alt=""><figcaption><p>Original background</p></figcaption></figure>

<figure><img src="https://3091318601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbPMRyh7BHNPMVqv2031A%2Fuploads%2FPqHCjK4DODdRQXCH0D87%2Fimage.png?alt=media&#x26;token=bdc5b197-b145-43de-a1b0-a3653a3c9e62" alt=""><figcaption><p>Cleaned background</p></figcaption></figure>
