VinAIResearch / CPM

💄 Lipstick ain't enough: Beyond Color-Matching for In-the-Wild Makeup Transfer (CVPR 2021)
https://thaoshibe.github.io/CPM
Apache License 2.0
367 stars 58 forks source link

Read-only CPM folder preventing me from running Colab example - Read-only file system: './result.png' #3

Closed vietanhdev closed 3 years ago

vietanhdev commented 3 years ago

Hello, As in your Colab instruction, I added a shortcut of CPM-Shared-Folder to my Drive. However, I don't have the permission to write to your Drive, so I see the following error when running your instruction:

Traceback (most recent call last):
  File "main.py", line 54, in <module>
    Image.fromarray((output).astype("uint8")).save(save_path)
  File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 2131, in save
    fp = builtins.open(filename, "w+b")
OSError: [Errno 30] Read-only file system: './result.png'

Suggested solutions: Point savedir to another directory:

# Pattern + Color: Image will be saved in 'result.png'
os.chdir(path)
!python -W ignore main.py --style ./imgs/style-1.png --input ./imgs/non-makeup.png --savedir=/content/

You should also update other commands.

vietanhdev commented 3 years ago

My modified version: https://colab.research.google.com/drive/1abjUknTiVAOgxmKSctItZcxkwQWV5KtD.

thaoshibe commented 3 years ago

Thank you for pointing out the issue.