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
4 stars 12 forks source link

Tutorial 3 issue with producing sample clips #237

Closed Bergylta closed 10 months ago

Bergylta commented 10 months ago

Before submitting a bug report, please be aware that your issue must be reproducible with all of the following, otherwise it is non-actionable, and we can not help you:

If this is a custom dataset/training question you must include your train*.jpg, test*.jpg and results.png figures, or we can not help you. You can generate these with utils.plot_results().

🐛 Bug

Seems to be something that has not been defined.

To Reproduce (REQUIRED)

pp.generate_zoo_clips( movie_name=pp.movie_selected, movie_path=pp.movie_path, is_example=True, use_gpu=gpu_available.result, ) Output:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
File ~/.local/lib/python3.8/site-packages/ipywidgets/widgets/interaction.py:257, in interactive.update(self, *args)
    255     value = widget.get_interact_value()
    256     self.kwargs[widget._kwarg] = value
--> 257 self.result = self.f(**self.kwargs)
    258 show_inline_matplotlib_plots()
    259 if self.auto_display and self.result is not None:

File /usr/src/app/kso/kso_utils/kso_utils/widgets.py:1182, in n_random_clips(clip_length, n_clips)
   1179 def n_random_clips(clip_length, n_clips):
   1180     # Create a list of starting points for n number of clips
   1181     # movie_df is currently missing here
-> 1182     duration_movie = int(movie_df["duration"].values[0])
   1183     starting_clips = random.sample(range(0, duration_movie, clip_length), n_clips)
   1185     # Seave the outputs in a dictionary

NameError: name 'movie_df' is not defined

Number of modifications:
0

image

Expected behavior

the expected behaviour is to be able to extract sample clips from the video

jannesgg commented 10 months ago

@victor-wildlife This is an issue that I also encountered and seems to be linked to code changes in the random clip selection widgets. Would you mind having a look to see if you could find a potential solution to getting the movie duration in this case?

jannesgg commented 10 months ago

We should try to combine the code for generating example clips and the clips from the full movie into a single function and use a default number of example clips, e.g. 3.