Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zzhanghub opened this issue Mar 15, 2024 · 2 comments
Closed

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

zzhanghub opened this issue Mar 15, 2024 · 2 comments

Comments

@zzhanghub
Copy link

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
Copy link
Author

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
Copy link
Owner

Kiteretsu77 commented Mar 15, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants