Skip to content

Commit

Permalink
remove watermark removal demos.
Browse files Browse the repository at this point in the history
  • Loading branch information
sczhou committed Sep 25, 2023
1 parent a391704 commit 8d05ddd
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 5 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<a href="https://arxiv.org/abs/2309.03897" target='_blank'>
<img src="https://img.shields.io/badge/arXiv-2309.03897-b31b1b.svg">
</a>
<a href="https://youtu.be/Cc89WF-2zz0" target='_blank'>
<a href="https://youtu.be/92EHfgCO5-Q" target='_blank'>
<img src="https://img.shields.io/badge/Demo%20Video-%23FF0000.svg?logo=YouTube&logoColor=white">
</a>
<img src="https://api.infinitescript.com/badgen/count?name=sczhou/ProPainter">
Expand All @@ -48,7 +48,7 @@


## Update
- **2023.09.24**: We remove the watermark removal demo officially to prevent the misuse of our work for unethical purposes.
- **2023.09.24**: We remove the watermark removal demos officially to prevent the misuse of our work for unethical purposes.
- **2023.09.21**: Add features for memory-efficient inference. Check our [GPU memory](https://github.com/sczhou/ProPainter#-memory-efficient-inference) requirements. 🚀
- **2023.09.07**: Our code and model are publicly available. 🐳
- **2023.09.01**: This repo is created.
Expand Down Expand Up @@ -83,6 +83,14 @@
<img src="assets/video_completion2.gif">
</td>
</tr>
<tr>
<td>
<img src="assets/video_completion3.gif">
</td>
<td>
<img src="assets/video_completion4.gif">
</td>
</tr>
</table>


Expand Down Expand Up @@ -136,7 +144,7 @@ Run the following commands to try it out:
# The first example (object removal)
python inference_propainter.py --video inputs/object_removal/bmx-trees --mask inputs/object_removal/bmx-trees_mask
# The second example (video completion)
python inference_propainter.py --video inputs/video_completion/running_car.mp4 --mask inputs/video_completion/mask.png
python inference_propainter.py --video inputs/video_completion/running_car.mp4 --mask inputs/video_completion/mask_square.png --height 240 --width 432
```

The results will be saved in the `results` folder.
Expand All @@ -145,7 +153,7 @@ To test your own videos, please prepare the input `mp4 video` (or `split frames`
If you want to specify the video resolution for processing or avoid running out of memory, you can set the video size of `--width` and `--height`:
```shell
# process a 576x320 video; set --fp16 to use fp16 (half precision) during inference.
python inference_propainter.py --video inputs/video_completion/running_car.mp4 --mask inputs/video_completion/mask.png --height 320 --width 576 --fp16
python inference_propainter.py --video inputs/video_completion/running_car.mp4 --mask inputs/video_completion/mask_square.png --height 320 --width 576 --fp16
```

### 🚀 Memory-efficient inference
Expand Down
Binary file modified assets/video_completion1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/video_completion2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/watermark_removal1.gif
Binary file not shown.
Binary file removed assets/watermark_removal2.gif
Binary file not shown.
3 changes: 2 additions & 1 deletion inference_propainter.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def get_ref_index(mid_neighbor_id, neighbor_ids, length, ref_stride=10, ref_num=
else:
start_idx = max(0, mid_neighbor_id - ref_stride * (ref_num // 2))
end_idx = min(length, mid_neighbor_id + ref_stride * (ref_num // 2))
for i in range(start_idx, end_idx + 1, ref_stride):
for i in range(start_idx, end_idx, ref_stride):
if i not in neighbor_ids:
if len(ref_index) > ref_num:
break
Expand Down Expand Up @@ -254,6 +254,7 @@ def get_ref_index(mid_neighbor_id, neighbor_ids, length, ref_stride=10, ref_num=
green = np.zeros([h, w, 3])
green[:,:,1] = 255
alpha = 0.6
# alpha = 1.0
fuse_img = (1-alpha)*img + alpha*green
fuse_img = mask_ * fuse_img + (1-mask_)*img
masked_frame_for_save.append(fuse_img.astype(np.uint8))
Expand Down
Binary file added inputs/video_completion/mask_logo.png
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 inputs/video_completion/mask_square.png
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 inputs/video_completion/running_car.mp4
Binary file not shown.
Binary file removed inputs/watermark_removal/mask.png
Binary file not shown.
Binary file removed inputs/watermark_removal/running_car.mp4
Binary file not shown.

0 comments on commit 8d05ddd

Please sign in to comment.