sensity-ai / dot

The Deepfake Offensive Toolkit
BSD 3-Clause "New" or "Revised" License
4.13k stars 410 forks source link

Add Colab demo for testing without webcam #9

Closed netrunner-exe closed 2 years ago

netrunner-exe commented 2 years ago

Please add Colab demo for testing without webcam, thanks!

giorgiop commented 2 years ago

This script works without webcam feed: https://github.com/sensity-ai/dot/blob/main/scripts/video_swap.py You will need access to GPU though, unless you run it on colab yourself

hichemfelouat commented 2 years ago

Hi, I found many issues when I tried to run it myself on Google Colab. The old version worked but not the new one. could you check it, please!

giorgiop commented 2 years ago

@hichemfelouat could you give us instructions for reproducing the issue please?

hichemfelouat commented 2 years ago

@giorgiop This version has many files that need to extend the PYTHONPATH.

giorgiop commented 2 years ago

Can you provide instructions for reproducing the issues? Exactly what commands you are running including on which data

hichemfelouat commented 2 years ago

@giorgiop The issue is about extending the PYTHONPATH. So for example when we use video_swap.py like this : !python /content/dot/scripts/video_swap.py \ -c /content/dot/dot/simswap/configs/config.yaml \ -s /content/my_img.jpg \ -t /content/my_video.mp4 \ -o /content/my_result

The error : Traceback (most recent call last): File "/content/dot/scripts/video_swap.py", line 10, in import dot ModuleNotFoundError: No module named 'dot'

One of the solutions is to add to video_swap.py file import sys sys.path.append("/content/dot/dot/")

But unfortunately, approximately all the files need to add to them the two above lines and update their from ... import and import that is too hard when we work on google colab.

giorgiop commented 2 years ago

Are you using a conda env? that should solve it

hichemfelouat commented 2 years ago

@giorgiop I tried to install conda on google colab bit still not working. it needs to add them myself like this : %set_env PYTHONPATH=/env/python:/content/dot/dot:/content/dot/dot/commons

this task so hard, could you pleas share with us a notebook about using dot on google colab?

ajndkr commented 2 years ago

@hichemfelouat we've added a demo notebook for google colab: https://colab.research.google.com/github/sensity-ai/dot/blob/main/notebooks/colab_demo.ipynb

hichemfelouat commented 2 years ago

@AjinkyaIndulkar Thank you so much I really appreciate that.