baowenbo / DAIN

Depth-Aware Video Frame Interpolation (CVPR 2019)
https://sites.google.com/view/wenbobao/dain
MIT License
8.18k stars 839 forks source link

OSError: unknown file format #149

Open kilik128 opened 2 years ago

kilik128 commented 2 years ago

got this

/content/DAIN revise the unique id to a random numer 67519 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/67519-Sun-Jan-23-12-26/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/67519-Sun-Jan-23-12-26/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=False, save_path='./model_weights/67519-Sun-Jan-23-12-26', save_which=1, seed=1, start_frame=1, time_step=0.11988011988011989, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 7 frames Traceback (most recent call last): File "colab_interpolate.py", line 64, in big_font = ImageFont.truetype(urlopen(font_url), size=24) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 648, in truetype return freetype(font) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 645, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 197, in init load_from_bytes(font) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 179, in load_from_bytes "", size, index, encoding, self.font_bytes, layout_engine OSError: unknown file format

on !python -W ignore colab_interpolate.py --netName DAIN_slowmotion --time_step {fps/TARGET_FPS} --start_frame 1 --end_frame {pngs_generated_count} --frame_input_dir '{FRAME_INPUT_DIR}' --frame_output_dir '{FRAME_OUTPUT_DIR}'

AlphaGit commented 2 years ago

Hi! Please verify that the files are accessible in the right directory and that, if using a networked source like GDrive, the connection is active.

kilik128 commented 2 years ago

for say true we got this

]
1 s
# Clone DAIN sources
# TODO Bring back original repo
!git clone https://github.com/baowenbo/DAIN /content/DAIN
%cd /content
!rm -rf DAIN
!git clone -b colab-compatibility --depth 1 https://github.com/AlphaGit/DAIN /content/DAIN
%cd /content/DAIN
!git log -1
fatal: destination path '/content/DAIN' already exists and is not an empty directory.
/content
Cloning into '/content/DAIN'...
warning: Could not find remote branch colab-compatibility to clone.
fatal: Remote branch colab-compatibility not found in upstream origin
[Errno 2] No such file or directory: '/content/DAIN'
/content
fatal: not a git repository (or any of the parent directories): .git

on this line

# Clone DAIN sources
# TODO Bring back original repo
!git clone https://github.com/baowenbo/DAIN /content/DAIN
%cd /content
!rm -rf DAIN
!git clone -b colab-compatibility --depth 1 https://github.com/AlphaGit/DAIN /content/DAIN
%cd /content/DAIN
!git log -1

i try this one too https://colab.research.google.com/drive/1pLMrFFAZzbS4CEzpmwsGXkKNBuPlHPDo#scrollTo=mwYCvA4EZn8O

AlphaGit commented 2 years ago

This line:

warning: Could not find remote branch colab-compatibility to clone.

Makes me think you might be using an outdated version.

Try this one: https://colab.research.google.com/github/AlphaGit/DAIN/blob/master/Colab_DAIN.ipynb

I have included several updates and fixes in it, which should match the version from here: https://github.com/AlphaGit/DAIN

Let me know if it helps!

kilik128 commented 2 years ago

look finish on same error at first have must add !pip install opencv-python and this line look not found # import ipyplot maybie beaucause that's have change this line too %shell yes | cp -f /content/gdrive/MyDrive/{INPUT_FILEPATH} /content/DAIN/

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

about front import

`

Interpolation

%shell mkdir -p '{FRAME_OUTPUT_DIR}' %cd /content/DAIN

!python -W ignore colab_interpolate.py --netName DAIN_slowmotion --time_step {fps/TARGET_FPS} --start_frame 1 --end_frame {frame_count} --frame_input_dir '{FRAME_INPUT_DIR}' --frame_output_dir '{FRAME_OUTPUT_DIR}' --mixer={FRAME_MIXER} --resize_hotfix {RESIZE_HOTFIX} /content/DAIN revise the unique id to a random numer 40885 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/40885-Mon-Jan-24-08-26/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/40885-Mon-Jan-24-08-26/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=True, save_path='./model_weights/40885-Mon-Jan-24-08-26', save_which=1, seed=1, start_frame=1, time_step=0.1998001998001998, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 4 frames Traceback (most recent call last): File "colab_interpolate.py", line 64, in big_font = ImageFont.truetype(urlopen(font_url), size=24) File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 855, in truetype return freetype(font) File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 852, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 215, in init load_from_bytes(font) File "/usr/local/lib/python3.7/site-packages/PIL/ImageFont.py", line 197, in load_from_bytes "", size, index, encoding, self.font_bytes, layout_engine OSError: unknown file format`

so i have change the colab interpotale for import manualy

big_font = ImageFont.truetype("/content/DAIN/Roboto-Bold.ttf"), size=24) smol_font = ImageFont.truetype("/content/DAIN/Roboto-Bold.ttf"), size=14)

/content/DAIN revise the unique id to a random numer 142 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/142-Mon-Jan-24-08-42/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/142-Mon-Jan-24-08-42/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=True, save_path='./model_weights/142-Mon-Jan-24-08-42', save_which=1, seed=1, start_frame=1, time_step=0.1998001998001998, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 4 frames 3% 1/35 [00:00<00:00, 38.69it/s] Traceback (most recent call last): File "colab_interpolate.py", line 395, in <module> interpolate_mixer(input_frame) File "colab_interpolate.py", line 213, in normal_interpolate interpolate(input_frame, input_frame+1) File "colab_interpolate.py", line 205, in interpolate for frame, time_offset in zip(subframes(image_1, image_2), time_offsets): File "colab_interpolate.py", line 125, in subframes assert channels == 3 AssertionError

AlphaGit commented 2 years ago

Hi! Sorry, I don't fully understand how this part is related:

big_font = ImageFont.truetype("/content/DAIN/Roboto-Bold.ttf"), size=24) smol_font = ImageFont.truetype("/content/DAIN/Roboto-Bold.ttf"), size=14)

Are you manually importing fonts? What are you doing with them?

kilik128 commented 2 years ago

yes manually importing fonts for try fix the File "colab_interpolate.py", line 64

AlphaGit commented 2 years ago

I see -- those fonts are only used to write over the image and debug intermediate interpolation results.

Feel free to comment out:

And replaces the contents of the the d debug method (lines 339 to 342) with the word "pass". This would take out all that interaction and still allow the rest of the notebook to run.

kilik128 commented 2 years ago

got one frame result and assertionError

/content/DAIN revise the unique id to a random numer 65014 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/65014-Wed-Jan-26-09-36/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/65014-Wed-Jan-26-09-36/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=True, save_path='./model_weights/65014-Wed-Jan-26-09-36', save_which=1, seed=1, start_frame=1, time_step=0.1998001998001998, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 4 frames 3% 1/35 [00:00<00:00, 41.87it/s] Traceback (most recent call last): File "colab_interpolate.py", line 397, in interpolate_mixer(input_frame) File "colab_interpolate.py", line 213, in normal_interpolate interpolate(input_frame, input_frame+1) File "colab_interpolate.py", line 205, in interpolate for frame, time_offset in zip(subframes(image_1, image_2), time_offsets): File "colab_interpolate.py", line 125, in subframes assert channels == 3 AssertionError

have try and retry

AlphaGit commented 2 years ago

Good, progress!

It seems that your image files have 4 channels instead of 3. DAIN can only work with 3. Maybe they have a transparency layer?

Make sure that the part of the code that removes the alpha layer is running.

On Wed, Jan 26, 2022 at 4:41 AM kilik128 @.***> wrote:

got one frame result and assertionError

/content/DAIN revise the unique id to a random numer 65014 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/65014-Wed-Jan-26-09-36/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/65014-Wed-Jan-26-09-36/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=True, save_path='./model_weights/65014-Wed-Jan-26-09-36', save_which=1, seed=1, start_frame=1, time_step=0.1998001998001998, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 4 frames 3% 1/35 [00:00<00:00, 41.87it/s] Traceback (most recent call last): File "colab_interpolate.py", line 397, in interpolate_mixer(input_frame) File "colab_interpolate.py", line 213, in normal_interpolate interpolate(input_frame, input_frame+1) File "colab_interpolate.py", line 205, in interpolate for frame, time_offset in zip(subframes(image_1, image_2), time_offsets): File "colab_interpolate.py", line 125, in subframes assert channels == 3 AssertionError

have try and retry

— Reply to this email directly, view it on GitHub https://github.com/baowenbo/DAIN/issues/149#issuecomment-1022027329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIP2WMFTOCMTPEU34C74GTUX66TVANCNFSM5MTJB6CA . You are receiving this because you commented.Message ID: @.***>

kilik128 commented 2 years ago

Done Thank's ! it's realy cool :)