APLOSE detections#400
Conversation
| "confidence_indicator_label", | ||
| "confidence_indicator_level", | ||
| "label", | ||
| "level", |
There was a problem hiding this comment.
The column names hasn't change on APLOSE side
There was a problem hiding this comment.
damn good catch, I didn't see that my refactor affected also the dict keys!
I really should write an integration test before messing with everything 🥸
|
|
|
Good catch, I indeed didn't notice the (if exists) part in the csv file description, I'll fix that shortyl! |
|
@Gautzilla I have an error when using a yolo-aplose-formatted csv because i do not have all the required columns annotations = Detection.from_csv(Path(r"C:\Users\dupontma2\Downloads\check\C16D1_ST7189_yolo_v2_prediction.csv"))
Traceback (most recent call last):
File "C:\Users\dupontma2\Documents\Git\OSmOSE\OSEkit\.venv\Lib\site-packages\IPython\core\interactiveshell.py", line 3701, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<ipython-input-5-a298c7373fb5>", line 1, in <module>
annotations = Detection.from_csv(Path(r"C:\Users\dupontma2\Downloads\check\C16D1_ST7189_yolo_v2_prediction.csv"))
File "C:\Users\dupontma2\Documents\Git\OSmOSE\OSEkit\src\osekit\core\detection.py", line 413, in from_csv
return [cls.from_dict(record) for record in records]
~~~~~~~~~~~~~^^^^^^^^
File "C:\Users\dupontma2\Documents\Git\OSmOSE\OSEkit\src\osekit\core\detection.py", line 303, in from_dict
detection_id=row["annotation_id"],
~~~^^^^^^^^^^^^^^^^^
KeyError: 'annotation_id'We need to specify which column are in deed mandatory, to me that would be:
@ElodieENSTA what do you think ? |
I don't think the filename is mandatory with continuous datasets, since you have the timestamps. So start/end relative time should not be mandatory as well. |
Maybe the bare minimum should only be what a detector outputs at bare minimum?
Not sure which parameters truly are mandatory in every detector output tho |
@Gautzilla I still get this error when loading a custom APLOSE formatted csv that does not contains certains columns like Also 2 points:
|
|
@ElodieENSTA The only mandatory columns are now
|
|
|
||
| def __repr__(self) -> str: | ||
| """Override the string representation of the detection.""" | ||
| return str(self.metadata.detection_id) |
There was a problem hiding this comment.
I would prefer another str method that's relevant to detections without an detection_id maybe something like
def __repr__(self) -> str:
return str(f"{self.metadata.detection_id} - {self.begin} - {self.end} - {self.frequency_bounds}")
>>> detection = Detection(...)
>>> print(detection)
>>> None - 2023-02-11 12:03:50+01:00 - 2023-02-11 12:04:00+01:00 - FrequencyBounds(min=0, max=64000)?
|
Another thing! It would be nice to have a |
I don't exaclty get why this will be usefull, but if you need it, all the colors are here : https://github.com/Project-OSmOSE/APLOSE/blob/chore/base-ui-with-storybook/frontend/src/css/annotation.scss |
It's mainly for convenience! I am quite familiar with APLOSE default colors so I might as well implement it as default colors here 🤷 |

🖼️ Annotation results are coming to OSEkit!
How does it work
The idea is to be able to load APLOSE results csv into OSEkit as a collection of new
Annotationobjects:The annotations could then be filtered thanks to their properties :
Using the
Annotationwith OSEkitThe
Annotationclass inherits from theEventclass: itsbeginandendproperties can be used to access the audio corresponding to the annotation box easily, e.g.: