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

Notebook 9 issue with aggregating the annotations #345

Closed Bergylta closed 5 months ago

Bergylta commented 5 months ago

🐛 Bug

A clear and concise description of what the bug is.

To Reproduce (REQUIRED)

Footage:/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_GU/concatenated/220809_LANG_01_MARK2.mp4 Save location:/mimer/NOBACKUP/groups/snic2021-6-9/project_movies/movies_GU/concatenated/220809_LANG_01_MARK2.mp4 Experiment name: Lang01_mark2_2 Input:

agg_df = t_utils.aggregate_detections(
    project=pp.project,
    db_connection=pp.db_connection,
    csv_paths=pp.csv_paths,
    annotations_csv_path=mlp.eval_dir,
    movies_selected_id=pp.movies_selected_id,
    model_registry=mlp.registry,
    model=model.value,
    team_name=mlp.team_name,
    project_name=mlp.project_name,
)

Output:

AttributeError                            Traceback (most recent call last)
Cell In[20], line 6
      1 agg_df = t_utils.aggregate_detections(
      2     project=pp.project,
      3     db_connection=pp.db_connection,
      4     csv_paths=pp.csv_paths,
      5     annotations_csv_path=mlp.eval_dir,
----> 6     movies_selected_id=pp.movies_selected_id,
      7     model_registry=mlp.registry,
      8     model=model.value,
      9     team_name=mlp.team_name,
     10     project_name=mlp.project_name,
     11 )

AttributeError: 'ProjectProcessor' object has no attribute 'movies_selected_id'

Expected behavior

Environment

If applicable, add screenshots to help explain your problem.

Additional context

Might be that it is a function not yet implemented and i was too eager

jannesgg commented 5 months ago

@victor-wildlife It seems that the aggregation output we get now does not match the format we used to have in agg_template_project function, which is the one that Leon would like to use. Is there a way we can add back those columns etc. in this new plot_aggregate_detections function? I also see that the "thres" keyword argument is not currently used in this function, so we do not filter out any counts.

jannesgg commented 5 months ago

Here is the old function for reference: https://github.com/ocean-data-factory-sweden/kso/blob/4f4261a053e6e7a4f24385a78196a518311606ff/kso_utils/tutorials_utils.py#L1652

victor-wildlife commented 5 months ago

@jannesgg what would be the best .sh file (from the jupter_envs folder) to test the code works in SNIC?