Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fuseformer #1448

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ The collection of pre-trained, state-of-the-art AI models.
[ailia MODELS tutorial 日本語版](TUTORIAL_jp.md)

# Supported models
320 models as of March 29th, 2024
321 models as of April 9th, 2024

# Latest update
- 2024.04.09 Add fuseformer
- 2024.03.29 Add falcon-adapter-network-packet, pyannote-audio
- 2024.03.08 Add did_m3d, damo_yolo, deep-music-enhancer, tusimple-DUC
- 2024.03.05 Add polylanenet, rnnoise
Expand Down Expand Up @@ -570,6 +571,12 @@ The collection of pre-trained, state-of-the-art AI models.
| [<img src="vehicle_recognition/vehicle-attributes-recognition-barrier/demo.png" width=64px>](/vehicle_recognition/vehicle-attributes-recognition-barrier/) |[vehicle-attributes-recognition-barrier](/vehicle_recognition/vehicle-attributes-recognition-barrier) | [vehicle-attributes-recognition-barrier-0042](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/vehicle-attributes-recognition-barrier-0042) | OpenVINO | 1.2.5 and later | [EN](https://medium.com/axinc-ai/vehicleattributerecognitionbarrier-a-machine-learning-model-for-detecting-car-attributes-fe8fda7649ff) [JP](https://medium.com/axinc/vehicleattributerecognitionbarrier-%E8%BB%8A%E3%81%AE%E5%B1%9E%E6%80%A7%E3%82%92%E6%A4%9C%E5%87%BA%E3%81%99%E3%82%8B%E6%A9%9F%E6%A2%B0%E5%AD%A6%E7%BF%92%E3%83%A2%E3%83%87%E3%83%AB-ee26d1a3e00b) |
| [<img src="vehicle_recognition/vehicle-license-plate-detection-barrier/output.png" width=128px>](vehicle_recognition/vehicle-license-plate-detection-barrier/) | [vehicle-license-plate-detection-barrier](/vehicle_recognition/vehicle-license-plate-detection-barrier/) | [vehicle-license-plate-detection-barrier-0106](https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/intel/vehicle-license-plate-detection-barrier-0106) | OpenVINO | 1.2.5 and later | |

## Video inpainting

| | Model | Reference | Exported From | Supported Ailia Version | Blog |
|:-----------|------------:|:------------:|:------------:|:------------:|:------------:|
| [<img src="video_inpainting/fuseformer/misc/bmx_trees_output.gif" width=128px>](video_inpainting/fuseformer) |[fuseformer](video_inpainting/fuseformer) | [FuseFormer](https://github.com/ruiliu-ai/FuseFormer) | PyTorch | Not supported yet | |

## Commercial model

| Model | Reference | Exported From | Supported Ailia Version | Blog |
Expand Down
3 changes: 2 additions & 1 deletion scripts/download_all_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,5 @@ cd ../../text_recognition/easyocr; python3 easyocr.py ${OPTION}
cd ../../text_recognition/ndlocr_text_recognition; python3 ndlocr_text_recognition.py ${OPTION}
cd ../../time_series_forecasting/informer2020; python3 informer2020.py ${OPTION}
cd ../../vehicle_recognition/vehicle-attributes-recognition-barrier; python3 vehicle-attributes-recognition-barrier.py ${OPTION}
cd ../../vehicle_recognition/vehicle-license-plate-detection-barrier; python3 vehicle-license-plate-detection-barrier.py ${OPTION}
cd ../../vehicle_recognition/vehicle-license-plate-detection-barrier; python3 vehicle-license-plate-detection-barrier.py ${OPTION}
cd ../../video_inpainting/fuseformer; python3 fuseformer.py ${OPTION}
62 changes: 62 additions & 0 deletions video_inpainting/fuseformer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# FuseFormer: Fusing Fine-Grained Information in Transformers for Video Inpainting

## Input

![Input video](misc/bmx_trees.gif)

(Video from https://github.com/sczhou/ProPainter/tree/main/inputs/object_removal/bmx-trees)

![Input mask example](bmx_trees_mask/00000.png)

(Image from https://github.com/sczhou/ProPainter/blob/main/inputs/object_removal/bmx-trees_mask/00000.png)

## Output

![Output video](misc/bmx_trees_output.gif)

## Usage
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 video,
``` bash
$ python3 fuseformer.py
```

If you want to specify the input video or input frames, put the video path or the input frames folder after the `--video` option. <br>
If you want to specify the input masked frames, put the input masked frames folder after the `--mask` option. <br>
You can use `--savepath` option to change the name of the output folder to save.
```bash
$ python3 fuseformer.py --video VIDEO_OR_FRAMES_PATH --mask MASKED_FRAMES_PATH --savepath SAVE_FOLDER_PATH
```

You can use `--width` and `--height`, or the `--resize_ratio` options to change the video resolution.
```bash
$ python3 fuseformer.py --width 432 --height 240
```

By adding the `--save_frames` option, you can save the output video frames.
```bash
$ python3 fuseformer.py --save_frames
```

By adding the `--onnx` option, you can run the inference using OnnxRuntime.
```bash
$ python3 fuseformer.py --onnx
```

## Reference

- [FuseFormer](https://github.com/ruiliu-ai/FuseFormer)

## Framework

Pytorch

## Model Format

ONNX opset = 18

## Netron

- [fuseformer.onnx.prototxt](https://netron.app/?url=https://storage.googleapis.com/ailia-models/fuseformer/fuseformer.onnx.prototxt)
Binary file added video_inpainting/fuseformer/bmx_trees.mp4
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00061.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00062.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00063.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00064.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00065.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00066.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00067.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00068.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00069.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00070.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00071.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00072.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00074.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00075.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00076.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00077.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00078.png
Binary file added video_inpainting/fuseformer/bmx_trees_mask/00079.png
Loading