ykdai / BasicPBC

Official Implementation of "Learning Inclusion Matching for Animation Paint Bucket Colorization"
Other
259 stars 23 forks source link

Do I need to create segmentation files? #6

Closed nathanshipley closed 7 months ago

nathanshipley commented 7 months ago

Trying with my own data and I have a reference ground truth frame and then 10 frames of hand-drawn animation to match:

image

However, I get an error:

FileNotFoundError: No such file: '/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/dataset/test/trinity01/gt/seg/0000.png'

Is there a tool that creates the proper segmentation images? Should I be doing that myself? Thank you!

Full stack error:

(basicpbc) nathan@nathan-ThinkStation-P620:~/AI/code/27_Basic_PBC_Paint/BasicPBC$ python inference_line_frames.py --folder_path /home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/dataset/test/trinity01
Traceback (most recent call last):
  File "/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/inference_line_frames.py", line 68, in <module>
    generate_seg_folder(path)
  File "/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/inference_line_frames.py", line 32, in generate_seg_folder
    extract_color_dict(clip_path)
  File "/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/inference_line_frames.py", line 37, in extract_color_dict
    seg = read_seg_2_np(osp.join(clip_path, "seg", "0000.png"))
  File "/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/paint/utils.py", line 79, in read_seg_2_np
    seg = io.imread(seg_path)
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/skimage/io/_io.py", line 53, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/skimage/io/manage_plugins.py", line 205, in call_plugin
    return func(*args, **kwargs)
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/skimage/io/_plugins/imageio_plugin.py", line 11, in imread
    out = np.asarray(imageio_imread(*args, **kwargs))
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/imageio/v3.py", line 53, in imread
    with imopen(uri, "r", **plugin_kwargs) as img_file:
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/imageio/core/imopen.py", line 113, in imopen
    request = Request(uri, io_mode, format_hint=format_hint, extension=extension)
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/imageio/core/request.py", line 247, in __init__
    self._parse_uri(uri)
  File "/home/nathan/anaconda3/envs/basicpbc/lib/python3.9/site-packages/imageio/core/request.py", line 407, in _parse_uri
    raise FileNotFoundError("No such file: '%s'" % fn)
FileNotFoundError: No such file: '/home/nathan/AI/code/27_Basic_PBC_Paint/BasicPBC/dataset/test/trinity01/gt/seg/0000.png'
dienachtderwelt commented 7 months ago

Hi put trinity01 under dataset/test/your_data/ so that the whole path is dataset/test/your_data/trinity01 and then run python inference_line_frames.py --folder_path dataset/test/your_data/ should work.

dienachtderwelt commented 7 months ago

Hi please pull the newest code and simply run python inference_line_frames.py --path dataset/test/trinity01. To check the segmentation result you can add the --save_color_seg arg. If your line frames contain unclosed region, try run with --seg_type trappedball.

In your screenshot a 0000.png under line seems missing. Line art of previous frame is necessary for next frame's prediction.

Hope you enjoy your exploration.

nathanshipley commented 7 months ago

Hi! Thank you for your reply last week. I forgot to reply and tell you that using the your_data folder worked on the previous commit! I was confused by that name. Appreciate it.