ocean-data-factory-sweden / kso

Notebooks to upload/download marine footage, connect to a citizen science project, train machine learning models and publish marine biological observations.
GNU General Public License v3.0
5 stars 11 forks source link

AttributeError in Upload subjects to Zooniverse in Alvis #433

Closed Bergylta closed 1 month ago

Bergylta commented 1 month ago

🐛 Bug

A error only present in the Alvis version of the notebook as far as i can see, shows up when trying to manually extract frames from movies.

To Reproduce (REQUIRED)

Input:

# Generate suitable frames for upload by modifying initial frames
pp.generate_custom_frames(
    input_path=input_folder.selected,
    output_path=output_folder.selected,
    skip_start=10,
    skip_end=10,
    num_frames=75,
    frames_skip=None,
)

Species chosen: Gobies, Flatfish Output:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /usr/src/app/kso/kso_utils/project.py:974, in ProjectProcessor.generate_custom_frames.<locals>.on_button_clicked(b)
    970 def on_button_clicked(b):
    971     movie_files = sorted(
    972         [
    973             f
--> 974             for f in input_path.iterdir()
    975             if f.is_file()
    976             and f.suffix.lower() in [".mov", ".mp4", ".avi", ".mkv"]
    977         ]
    978     )
    980     results = g_utils.parallel_map(
    981         kso_widgets.extract_custom_frames,
    982         movie_files,
   (...)
    990         ),
    991     )
    992     if len(results) > 0:

AttributeError: 'str' object has no attribute 'iterdir'

Expected behavior

A clear and concise description of what you expected to happen.

Environment

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

jannesgg commented 1 month ago

@Bergylta Are you working on the latest dev? This issue seems fixed on my end.