microsoft / Bringing-Old-Photos-Back-to-Life

Bringing Old Photo Back to Life (CVPR 2020 oral)
https://arxiv.org/abs/2004.09484
MIT License
14.94k stars 1.97k forks source link

Missing additional download #248

Open inobrevi opened 1 year ago

inobrevi commented 1 year ago
# pull the syncBN repo
%cd photo_restoration/Face_Enhancement/models/networks
!git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
!cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
%cd ../../../

%cd Global/detection_models
!git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
!cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
%cd ../../

# download the landmark detection model
%cd Face_Detection/
!wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
!bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
%cd ../

# download the pretrained model
%cd Face_Enhancement/
!wget https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Face_Enhancement/checkpoints.zip
!unzip checkpoints.zip
%cd ../

%cd Global/
!wget https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Global/checkpoints.zip
!unzip checkpoints.zip
%cd ../
/content/photo_restoration
/content/photo_restoration/Face_Enhancement
--2022-11-09 21:01:48--  https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Face_Enhancement/checkpoints.zip
Resolving facevc.blob.core.windows.net (facevc.blob.core.windows.net)... 20.60.228.1
Connecting to facevc.blob.core.windows.net (facevc.blob.core.windows.net)|20.60.228.1|:443... connected.
HTTP request sent, awaiting response... 404 The specified resource does not exist.
2022-11-09 21:01:49 ERROR 404: The specified resource does not exist..

unzip:  cannot find or open checkpoints.zip, checkpoints.zip.zip or checkpoints.zip.ZIP.
/content/photo_restoration
/content/photo_restoration/Global
--2022-11-09 21:01:49--  https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Global/checkpoints.zip
Resolving facevc.blob.core.windows.net (facevc.blob.core.windows.net)... 20.60.228.1
Connecting to facevc.blob.core.windows.net (facevc.blob.core.windows.net)|20.60.228.1|:443... connected.
HTTP request sent, awaiting response... 404 The specified resource does not exist.
2022-11-09 21:01:50 ERROR 404: The specified resource does not exist..

unzip:  cannot find or open checkpoints.zip, checkpoints.zip.zip or checkpoints.zip.ZIP.
/content/photo_restoration
inobrevi commented 1 year ago

I figured it out, you need ti download release and manually extract the checkpoints into right place.

seppemarotta commented 1 year ago

I figured it out, you need ti download release and manually extract the checkpoints into right place.

I've just done that but I always get _You are using the mapping model without global restoration._ , did you manage to make Global Restoration work ? @adamsatyr

inobrevi commented 1 year ago

I managed to make it fully functional, at least in Google collab.

Probably you didn't put global check point in correct folder or skipped extraction of syncBN repo

jolzi commented 1 year ago

Any infos on this? Manually downloaded and extracted checkpoints to Global/checkpoints and Face_Enhancement/checkpoints. Cloned and copied syncBN repo to final paths Face_Enhancement/models/networks/sync_batchnorm and Global/detection_models/sync_batchnorm. Is this correct? I still don't get global restoration

ZRomene commented 1 year ago

`%cd photo_restoration/Face_Enhancement/models/networks !git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch !cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . %cd ../../../

%cd Global/detection_models !git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch !cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm . %cd ../../

%cd Face_Detection/ !wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 !bzip2 -d shape_predictor_68_face_landmarks.dat.bz2 %cd ../

%cd Face_Enhancement/ !wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip !unzip face_checkpoints.zip %cd ../

%cd Global/ !wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip !unzip global_checkpoints.zip %cd ../`

You must correct the paths to extract the checkpoints.
Use !wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip !unzip face_checkpoints.zip in the place of !wget https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Face_Enhancement/checkpoints.zip !unzip checkpoints.zip

And !wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip !unzip global_checkpoints.zip in the place of !wget https://facevc.blob.core.windows.net/zhanbo/old_photo/pretrain/Global/checkpoints.zip !unzip checkpoints.zip

Fully worked for me !

spatiallysaying commented 11 months ago

Better to use full path. Facing issues related path with previous ways.


%cd /content/photo_restoration/Face_Enhancement/models/networks
!git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
!cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
%cd ../../../

%cd /content/photo_restoration/Global/detection_models
!git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
!cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
%cd ../../

%cd /content/photo_restoration/Face_Detection/
!wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
!bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
%cd ../

%cd /content/photo_restoration/Face_Enhancement/
!wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/face_checkpoints.zip
!unzip face_checkpoints.zip
%cd ../

%cd /content/photo_restoration/Global/
!wget https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life/releases/download/v1.0/global_checkpoints.zip
!unzip global_checkpoints.zip
%cd ../