Kiteretsu77 / APISR

APISR: Anime Production Inspired Real-World Anime Super-Resolution (CVPR 2024)
GNU General Public License v3.0
878 stars 61 forks source link

Help Needed with Missing `ck.pth` File in APISR Project #2

Closed zzhanghub closed 8 months ago

zzhanghub commented 8 months ago

Hi APISR Team,

I've been diving into APISR and it's awesome.

Here's a little snag I've hit, though. While running dataset_curation_pipeline/collect.py, I bumped into this snag:

FileNotFoundError: [Errno 2] No such file or directory: 'pretrained/ck.pth

I don't seem to have found this CKPT in the repo. Can you provide it?

The code seems to be looking for it right here:

class video_scoring:
    def __init__(self) -> None:

        # Init the model
        self.scorer = ICNet()
        self.scorer.load_state_dict(torch.load('pretrained/ck.pth',map_location=torch.device('cpu')))
        self.scorer.eval().cuda()

Thanks a ton for the help! Can't wait to get back to exploring APISR.

Cheers!

zzhanghub commented 8 months ago

Additionally, $output_dir_720p_crop is missing in scripts/prepare_datasets.sh

#!/bin/bash
# Set up the path (tmp_usm_dir will be removed; the rest will be kept)
full_patch_source=../APISR_dataset
tmp_usm_dir=GEASR_sharpen
degrade_hr_dataset_name=datasets/train_hr
train_hr_dataset_name=datasets/train_hr_enhanced

# Resize images and prepare usm sharpening in Anime
python scripts/anime_strong_usm.py -i $full_patch_source -o $tmp_usm_dir --outlier_threshold 32

# Crop images to the target HR and degradate_HR dataset
python scripts/crop_images.py -i $output_dir_720p_crop --crop_size 256 -o $degrade_hr_dataset_name
python scripts/crop_usm_only.py -i $tmp_usm_dir -o $train_hr_dataset_name --size 256

# Clean unnecessary file
rm -rf $tmp_usm_dir
Kiteretsu77 commented 8 months ago

Thank you for your feedback! I have added a way to download pretrained IC9600 in Readme(for the newest push). For the scripts/prepare_datasets.sh, I have also modified the scripts and pushed them to the newest commit. This new script should be capable of automatically handling cropping and hand-drawn line enhancement. Thanks!