Skip to content

Support for Videos / frames on OM #70

Open

Description

@luisremis
No description provided.

Activity

  1. ad-claw000 commented on Aug 12, 2026

    @ad-claw000
    Contributor

    This issue requests adding support for Video and Frame object mappers (OM) so users can interact with them natively in Python. While Videos (in aperturedb/Videos.py) and Frames (in aperturedb/Images.py) were introduced to the Object Mapper in late 2022, full ingestion support for Frames via CSV is currently missing, as is CLI support for IngestType.FRAME.

    Here are three possible approaches to fully resolve this:

    Approach A: Add a standalone FrameDataCSV.py
    We can create aperturedb/FrameDataCSV.py containing a new class that duplicates the loading logic of ImageDataCSV but sets self.command = "AddFrame", and register it in aperturedb/cli/ingest.py.

    • Pros:
      • Leaves ImageDataCSV.py completely untouched.
      • Plugs the missing IngestType.FRAME hole in the CLI.
    • Cons:
      • Duplicates complex image validation and S3/GCS fetching logic.

    Approach B: Refactor ImageDataCSV to easily support Frames
    We modify aperturedb/ImageDataCSV.py to allow self.command to be overridden. Then we create aperturedb/FrameDataCSV.py which simply inherits from ImageDataCSV and overrides self.command = "AddFrame". We also add it to ingest_types in aperturedb/cli/ingest.py.

    • Pros:
      • DRY (Don't Repeat Yourself) — reuses all the robustness of ImageDataCSV.
      • Clean and maintainable design.
    • Cons:
      • Requires a small modification to the __init__ of ImageDataCSV.py (around line 202).

    Approach C: Close issue as already completed
    We can assume the OM requirement was met by Videos.py and Frames (in Images.py) and simply close the issue without adding CSV ingestion support.

    • Pros:
      • Zero code changes required.
    • Cons:
      • Users using the CLI adb ingest from-csv with IngestType.FRAME will encounter a KeyError in aperturedb/cli/ingest.py.

    Recommendation:
    I recommend Approach B. Since Frames share the same validation and ingestion requirements as Images, FrameDataCSV can simply inherit from ImageDataCSV. We just need to change self.command = "AddImage" to self.command = getattr(self, "command", "AddImage") in ImageDataCSV.py, create aperturedb/FrameDataCSV.py, and register IngestType.FRAME: FrameDataCSV in aperturedb/cli/ingest.py (around line 147). This ensures parity for Frames across both the OM and ingestion utilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions