PeterWang512 / FALdetector

Code for the paper: Detecting Photoshopped Faces by Scripting Photoshop
https://peterwang512.github.io/FALdetector/
Apache License 2.0
1.57k stars 233 forks source link

Possible to make this setup and running at Google Colab? #25

Open SamuelChih opened 4 years ago

SamuelChih commented 4 years ago

Hi, thanks for making this great model!

With the recent meme "dame da ne" using deep fake to create face swap video, and someone set it up on Google Colab to make it easy to use for people like who have little to no coding experience. I wonder is possible for FALdetector to achieve the same thing?

hirusnov commented 4 years ago

It is very easy to install and use on colab. Step by step: 1: open new notebook and set runtime is GPU 2: connect to google drive for storage 3: " %cd " cd to drive folder 4: !git clone https://github.com/PeterWang512/FALdetector.git 5: %cd to folder FALdetector 6: Follow (2) Run our models on FALdetector github Goodluck to u

burninglay commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

hirusnov commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd

in step 3: use %cd /content/drive/MyDrive/ and start to clone github after clone: use %cd FALdetector to go to folder

burninglay commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd

in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

hirusnov commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

I dont know how to save result too. I think we can change the code, but i dont know.

SamuelChih commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

Hi, can you share the link to your colab model? I have trouble install the valset to the colab, plus there is no point to reinvent the wheel.

hirusnov commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

Hi, can you share the link to your colab model? I have trouble install the valset to the colab, plus there is no point to reinvent the wheel.

What wrong with you guys? Can you explain more?

SamuelChih commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

Hi, can you share the link to your colab model? I have trouble install the valset to the colab, plus there is no point to reinvent the wheel.

What wrong with you guys? Can you explain more?

image https://colab.research.google.com/drive/1qbZ53V3Lzwe5f_nRRJi2LaXXCV_Iw1Ij?usp=sharing Idk where did I do wrong, but it keep showing invalid syntax, after like 2 hr of trial and error this is where I gave up last time...

hirusnov commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

Hi, can you share the link to your colab model? I have trouble install the valset to the colab, plus there is no point to reinvent the wheel.

What wrong with you guys? Can you explain more?

image https://colab.research.google.com/drive/1qbZ53V3Lzwe5f_nRRJi2LaXXCV_Iw1Ij?usp=sharing Idk where did I do wrong, but it keep showing invalid syntax, after like 2 hr of trial and error this is where I gave up last time...

Ohhh I see you must use !python instead of python on colab Goodluck guy

hirusnov commented 3 years ago

Hi,when I trying to use on colab in step5: %cd it shows: /root I have already connect to my google drive how to chance to folder FALdetector?

Type that code: import os os.chdir('/content/drive/My Drive/folder name') after that, you can confirm it worked with the pwd command like this: !pwd in step 3: use %cd /content/drive/My\ Drive/ and start to clone github after clone: use %cd FALdetector to go to folder

thx for helping. I have run the model successfully: Probability being modified by Photoshop FAL: 5.25% But how can I save the Process picture(like Suggest undo ) as the demo shows?

Hi, can you share the link to your colab model? I have trouble install the valset to the colab, plus there is no point to reinvent the wheel.

What wrong with you guys? Can you explain more?

image https://colab.research.google.com/drive/1qbZ53V3Lzwe5f_nRRJi2LaXXCV_Iw1Ij?usp=sharing Idk where did I do wrong, but it keep showing invalid syntax, after like 2 hr of trial and error this is where I gave up last time...

you don't need to download valset, it is only used to validate the model's accuracy

hirusnov commented 3 years ago

Download the dataset

cd data !bash download_valset.sh cd ..

Run evaluation script. Model weights need to be downloaded.

!python eval.py --dataroot data --global_pth weights/global.pth --local_pth weights/local.pth --gpu_id 0 This is true code for download valset and test

konsumer commented 3 years ago

I made one you can fork, see #31 In the issue I have some notes on more efficient file stuff (via Drive) including saving the files in a Drive dir, and several ways to collect input images.