BLINK-SG / 4K-Video-Converter

http://blinky.cf
8 stars 0 forks source link

Determine models according to model names #1

Open snlog opened 1 year ago

snlog commented 1 year ago

HI! HD.ipynb 👍👏 Setting-Environment 👇 !wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth -P experiments/pretrained_models !wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P experiments/pretrained_models 👇 Change "filename.mp4" to your clips name to Start Render 'RealESRGAN_x4plus" or "RealESRGAN_x2plus" python inference_realesrgan_video.py -i upload/filename.mp4 -n RealESRNet_x4plus -s 2 --suffix outx2 or RealESRGAN_x2plus or RealESRGAN_x4plus 😏

snlog commented 1 year ago

https://github.com/xinntao/Real-ESRGAN/blob/master/inference_realesrgan_video.py def inference_video(args, video_save_path, device=None, total_workers=1, worker_idx=0):

---------------------- determine models according to model names ----------------------

172 args.model_name = args.model_name.split('.pth')[0] if args.model_name in ['RealESRGAN_x4plus', 'RealESRNet_x4plus']: # x4 RRDBNet model model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=4) netscale = 4 elif args.model_name in ['RealESRGAN_x4plus_anime_6B']: # x4 RRDBNet model with 6 blocks model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=6, num_grow_ch=32, scale=4) netscale = 4 elif args.model_name in ['RealESRGAN_x2plus']: # x2 RRDBNet model model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=2) netscale = 2 elif args.model_name in ['realesr-animevideov3']: # x4 VGG-style model (XS size) model = SRVGGNetCompact(num_in_ch=3, num_out_ch=3, num_feat=64, num_conv=16, upscale=4, act_type='prelu') netscale = 4 else: raise NotImplementedError

BLINK-SG commented 1 year ago

Hey Snlog, Thanks for sharing that code with me. I'll look into it and make the necessary modifications ASAP.