vitrivr / cineast

Cineast is a multi-feature content-based mulitmedia retrieval engine. It is capable of retrieving images, audio- and video sequences as well as 3d models based on edge or color sketches, textual descriptions and example objects.
MIT License
56 stars 51 forks source link

Optionally Have Segment Exporters Derive From AbstractSegmentExporter. #381

Open faberf opened 1 year ago

faberf commented 1 year ago

For the upcoming features in the external-api-extraction branch, it would be useful to extract features from audio by sending a binary wav file data to the api. Exporting a wav file already exists in cineast, but the functionality was hard-coded to export to a local file and not an arbitrary data stream. To address this issue I refactored AudioSegmentExporter to inherit from AbstractSegmentExporter. This allows the programmer to only define how to export to a stream and then processSegment and other functions work automatically. I also implemented this on AudioSpectogramExporter as an example.

faberf commented 1 year ago

For me it is useful to get some feedback from the experienced cineast developers for this change in isolation, as the ExternalApiExtraction branch does not make any changes to existing infrastructure. If this is not a vaid use for making a pull request, please let me know. "Optionally" refers to the fact that I am not making any breaking changes to existing exporters. They still work if they do not derive from AbstractSegmentExporter. If there is a need they can be refactored so that they derive from AbstractSegmentExporter and inherit additional functionality. Due to prioritization, I chose only to refactor two exporters for demonstration purposes.