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

Implement tool to generate and extract training data for bbc_clean #1

Closed
frenchfaso opened this issue Mar 30, 2023 · 3 comments
Closed
Assignees

Comments

@frenchfaso
Copy link

No description provided.

@frenchfaso frenchfaso changed the title Implement tool to generate and extract trainin data for bbcclean Implement tool to generate and extract trainin data for bbc_clean Mar 30, 2023
@zgypa zgypa changed the title Implement tool to generate and extract trainin data for bbc_clean Implement tool to generate and extract training data for bbc_clean Mar 30, 2023
@zgypa
Copy link
Member

zgypa commented Mar 30, 2023

@frenchfaso : there are a few issues with the first run we did today:

  1. The images produced are not only resized, but they are also rotated 180 degrees and mirrored.

image

  1. The tool crashed at 737/2477 with the following error:
[737/2477] SAVED: resized\B2408\Chest&Shoulder|B2408CSF04y06m.png
Traceback (most recent call last):
  File "C:\Users\afm\Downloads\bbc2digital-feature-1-bbc-clean-data-extractor\bbc2digital-feature-1-bbc-clean-data-extractor\bbc_clean\treerez\treerez.py", line 104, in <module>
    main(args)
  File "C:\Users\afm\Downloads\bbc2digital-feature-1-bbc-clean-data-extractor\bbc2digital-feature-1-bbc-clean-data-extractor\bbc_clean\treerez\treerez.py", line 85, in main
    convert(scans)
  File "C:\Users\afm\Downloads\bbc2digital-feature-1-bbc-clean-data-extractor\bbc2digital-feature-1-bbc-clean-data-extractor\bbc_clean\treerez\treerez.py", line 59, in convert
    cropped_np_im = autotrim(np_im)
                    ^^^^^^^^^^^^^^^
  File "C:\Users\afm\Downloads\bbc2digital-feature-1-bbc-clean-data-extractor\bbc2digital-feature-1-bbc-clean-data-extractor\bbc_clean\treerez\treerez.py", line 46, in autotrim
    x0, y0 = coords.min(axis=0)
    ^^^^^^
ValueError: too many values to unpack (expected 2)

@frenchfaso
Copy link
Author

frenchfaso commented Mar 31, 2023

Pillow had an issue handling the TIFF orientation tag python-pillow/Pillow#4053 which should be solved as of python-pillow/Pillow#4063
Any Chance windows file explorer simply ignores the TIFF orientation tag?
Have you tried opening both files (original and resized) in a proper image viewer/editor?

For investigating the second issue I would need the TIFF that triggered the crash which should be B2408\Chest&Shoulder\B2408CSF04y06m.tif

@zgypa
Copy link
Member

zgypa commented Apr 1, 2023

Yes, indeed. With Irfanview they look the same. I think this is done now. We should be able to merge back into develop.

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

When branches are created from issues, their pull requests are automatically linked.

2 participants