SamsungLabs / rome

Realistic mesh-based avatars. ECCV 2022
Other
428 stars 41 forks source link

cannot import name 'preprocess_dict' from 'data_utils' (/data_utils.py) colab #3

Closed robbsaber closed 1 year ago

robbsaber commented 2 years ago

Can't seem to get the colab notebook running. data_utils is there but I get this error on the second block.

khakhulin commented 2 years ago

Just skip this line. Maybe the working path should be changed earlier to run this relative importing.

robbsaber commented 2 years ago

Did so, also skipped the following on the second cell

parser.add_argument('--save_render', default='True', type=args_utils.str2bool, choices=[True, False])

parser.add_argument('--verbose', default='False', type=args_utils.str2bool, choices=[True, False])

parser = importlib.import_module(f'src.rome').ROME.add_argparse_args(parser)

This cell works after that. The next error I get is importing infer "module not found" so I installed infer and got a new error ImportError: cannot import name 'infer' from 'infer' (/usr/local/lib/python3.7/dist-packages/infer/init.py)

khakhulin commented 2 years ago

be sure that you are in the right working directory to import those files. Also, you don't need to comment the line of adding model arguments. I suggest to verify smth like this: python3 infer.py --deca DECA --rome data and then move on to notebook

plaidam commented 2 years ago

I'm having similar issues, any chance you could add a google colab to the GitHub repo?

khakhulin commented 2 years ago

The problem with colab is that DECA and FLAME licenses don't allow sharing them, as I can understand.

khakhulin commented 2 years ago

I checked the colab without weights:

! git clone https://github.com/SamsungLabs/rome.git
import os; os.chdir('rome') 

Comment os.chdir('..') line. Then you need to install pytorch3d and some libs smth like this is working (or check installation in the docs):

! curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz
! tar xzf 1.10.0.tar.gz
os.environ["CUB_HOME"] = os.getcwd() + "/cub-1.10.0"
! cd ../ && pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'

!pip install face-alignment
!pip install kornia

! git submodule update --init --recursive

Then you need to provide checkpoints and it will work 🪄

robbsaber commented 2 years ago

I still get an error on importing Infer. How do I get the checkpoints? Would it be possible to update the colab?

khakhulin commented 2 years ago

Follow this official script to download DECA. Separetly download ROME and MODNet.

Please be sure that you in the rome dir when you run importing.

robbsaber commented 2 years ago

/bin/bash: urle: command not found /bin/bash: urle: command not found Downloading FLAME... --2022-08-02 07:44:13-- https://download.is.tue.mpg.de/download.php?domain=flame&sfile=FLAME2020.zip&resume=1 Resolving download.is.tue.mpg.de (download.is.tue.mpg.de)... 192.124.27.139 Connecting to download.is.tue.mpg.de (download.is.tue.mpg.de)|192.124.27.139|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 6609 (6.5K) [text/html] Saving to: ‘./data/FLAME2020.zip’

./data/FLAME2020.zi 100%[===================>] 6.45K --.-KB/s in 0s

2022-08-02 07:44:14 (219 MB/s) - ‘./data/FLAME2020.zip’ saved [6609/6609]

Archive: ./data/FLAME2020.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of ./data/FLAME2020.zip or ./data/FLAME2020.zip.zip, and cannot find ./data/FLAME2020.zip.ZIP, period.

Downloading deca_model... wget: option requires an argument -- 'O' wget: missing URL Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

khakhulin commented 2 years ago

Have you fixed it with the proper files redistribution?