gmcnn-places2-tf¶
Use Case and High-Level Description¶
The gmcnn-places2-tf
is the TensorFlow* implementation of GMCNN Image Inpainting model,
aimed to estimate suitable pixel information to fill holes in images. gmcnn-places2-tf
is trained on Places2 dataset with free-form masks. Originally redistributed as checkpoint files,
it was converted to a frozen graph. For details see repository.
Steps to Reproduce Conversion to Frozen Graph¶
Clone the original repository
git clone https://github.com/shepnerd/inpainting_gmcnn.git
cd inpainting_gmcnn/tensorflow
Checkout the commit that the conversion was tested on:
git checkout ba7f710
Apply
freeze_model.patch
patch
git apply path/to/freeze_model.patch
Install the original dependencies. (TensorFlow* version used - 1.14.0, CPU).
Download the pre-trained weights
Run sample conversion script:
python3 freeze_model.py --ckpt_dir path/to/downloaded_weights --save_dir path/to/save_directory
Specification¶
Metric |
Value |
---|---|
Type |
Image Inpainting |
GFlops |
- |
MParams |
- |
Source framework |
TensorFlow* |
Accuracy¶
Accuracy metrics are obtained on 2000 image subset of VOC2012 dataset. Images were cropped to input size and disguised at random positions with pre-generated free-form masks.
Metric |
Value |
---|---|
PSNR |
33.41dB |
Input¶
Original Model¶
Image, name:
Placeholder
, shape:1, 512, 680, 3
, format:B, H, W, C
, where:B
- batch sizeH
- image heightW
- image widthC
- number of channels
Expected color order:
BGR
.Mask, name:
Placeholder_1
, shape:1, 512, 680, 1
, format:B, H, W, C
, where:B
- batch sizeH
- mask heightW
- mask widthC
- number of channels
Converted Model¶
Image, name:
Placeholder
, shape:1, 512, 680, 3
, format:B, H, W, C
, where:B
- batch sizeH
- image heightW
- image widthC
- number of channels
Expected color order:
BGR
.Mask, name:
Placeholder_1
, shape:1, 512, 680, 1
, format:B, H, W, C
, where:B
- batch sizeH
- mask heightW
- mask widthC
- number of channels
Output¶
Original Model¶
Restored image, name Cast
, shape: 1, 512, 680, 3
, format: B, H, W, C
, where:
B
- batch sizeH
- image heightW
- image widthC
- number of channels
Expected color order: BGR
.
Converted Model¶
Restored image, name: Cast
, shape: 1, 3, 512, 680
, format: B, C, H, W
, where:
B
- batch sizeC
- number of channelsH
- image heightW
- image width
Expected color order: BGR
.
Download a Model and Convert it into OpenVINO™ IR Format¶
You can download models and if necessary convert them into OpenVINO™ IR format using the Model Downloader and other automation tools as shown in the examples below.
An example of using the Model Downloader:
omz_downloader --name <model_name>
An example of using the Model Converter:
omz_converter --name <model_name>
Demo usage¶
The model can be used in the following demos provided by the Open Model Zoo to show its capabilities:
Legal Information¶
The original model is distributed under the following license:
MIT License
Copyright (c) 2018 yiwang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.