-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add CSV ingestion support for Frames #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ad-claw000
wants to merge
44
commits into
develop
Choose a base branch
from
fix/70-add-frame-csv-ingest
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
c156814
feat: Add CSV ingestion support for Frames
fd0c808
fix(csv): override get_indices for FrameDataCSV and format
b8efa61
fix: address review comments for Frame OM, tests, and ingest cli
803e0fa
test(FrameDataCSV): fix syntax error in f-string
cce1bc7
fix: address latest copilot review comments (docstring, unused import…
e0886c5
fix: use __getattr__ for lazy Frames import
0b77b04
fix: address review comments on FrameDataModel and formatting
17ee930
fix: do not override url in FrameDataModel to avoid pydantic override…
f393910
test: add tests for Frames OM and clean up unused import
c9faff2
fix: revert FrameDataModel base class to IdentityDataModel to avoid b…
c560a56
fix: export Frames in __all__ for import * support
8d99ccf
fix: ensure FrameDataModel inherits from BlobDataModel
83878fd
fix: cache Frames class in globals during lazy import
087f510
fix: address review comments on frame models and tests
b3d4e59
fix: address suppressed copilot review comments
d0beaec
fix: address review comments on FrameDataModel exception and Frames t…
b34b3cc
fix: address latest copilot review comments
a50b275
fix: address latest copilot review comments
401f06a
fix: address latest suppressed copilot review comments
413c708
fix: address latest review feedback on ImageDataCSV and Images __all__
a8bb224
fix: address latest review comments on docstrings, DataModels, Images…
118e8e0
style: fix autopep8 formatting issues
3a92a2f
Address Copilot feedback: add __all__ to Images.py and remove unused …
a576464
fix: address final review feedback on Images.__all__ and test names/a…
f0dea51
feat: add Frame to Object Model, analogous to Image and Video
974efc7
fix: remove annotations from __all__ in Images.py
95ba433
fix: ensure FrameDataModel inherits from BlobDataModel properly
c007003
fix: ignore rm failure during teardown to avoid failing CI
8abf9b1
fix: address suppressed review comments on Images.__all__, Constants,…
3618a49
Address suppressed Copilot reviewer comments
42575c5
Address remaining Copilot reviewer comments
675788c
chore: address remaining Copilot review comments
4246370
chore: address remaining suppressed Copilot review comments
c0500c7
chore: address remaining Copilot review comments (Croissant skip-list…
4a2060a
Address suppressed Copilot PR review comments
ec043dc
Address suppressed Copilot review comments
e78cb1d
Address latest suppressed Copilot review comments
ed0c692
fix: use local skip-list for Croissant indexing instead of BLOB_ADD_C…
c5bdd66
fix(mlcroissant): derive skip list from BLOB_ADD_COMMANDS
93ec0c5
fix: address latest review comments on Frames PR
5b152cf
fix: replace eager import with __getattr__ shim to avoid circular import
ab160d8
fix: remove unused Optional import from DataModels.py
62dfcad
fix: add Frame to OM (types and utils) as requested
d6955f6
fix: remove redundant DeleteFrame in remove_all_objects
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| """ | ||
| Shared constants for the ApertureDB Python SDK. | ||
| """ | ||
|
|
||
| BLOB_ADD_COMMANDS = frozenset({ | ||
| "AddImage", | ||
| "AddDescriptor", | ||
| "AddVideo", | ||
| "AddBlob", | ||
| "AddFrame" | ||
| }) | ||
|
|
||
| BLOB_FIND_COMMANDS = frozenset({ | ||
| "FindImage", | ||
| "FindDescriptor", | ||
| "FindVideo", | ||
| "FindBlob", | ||
| "FindFrame", | ||
| "FindBoundingBox" | ||
| }) | ||
|
|
||
| OPENCV_DECODE_FIND_COMMANDS = frozenset({ | ||
| "FindImage", | ||
| "FindFrame" | ||
| }) | ||
|
|
||
| PROPERTY_ADD_COMMANDS = frozenset({ | ||
| "AddImage", | ||
| "AddVideo", | ||
| "AddBoundingBox", | ||
| "AddPolygon", | ||
| "AddFrame" | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| from aperturedb.ImageDataCSV import ImageDataCSV | ||
| from aperturedb.Query import ObjectType | ||
|
|
||
|
|
||
| class FrameDataCSV(ImageDataCSV): | ||
| """ | ||
| **Helper class to ingest Frame data from a CSV file.** | ||
|
|
||
| This class extends ImageDataCSV and sets the insertion command to "AddFrame", | ||
| allowing frame files to be batch ingested from CSVs just like images. | ||
| """ | ||
| command = "AddFrame" | ||
|
|
||
| def get_indices(self): | ||
| return { | ||
| "entity": { | ||
| ObjectType.FRAME.value: self.get_indexed_properties() | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from aperturedb.Images import Images | ||
| from aperturedb.Query import ObjectType | ||
|
|
||
|
|
||
| class Frames(Images): | ||
| """ | ||
| **The python wrapper of frame images in ApertureDB.** | ||
|
|
||
| Frames in ApertureDB are quite similar to images and so | ||
| are modeled in python as a subclass. | ||
|
|
||
|
|
||
| Args: | ||
| client: The database connector, perhaps as returned by `CommonLibrary.create_connector` | ||
| """ | ||
| db_object = ObjectType.FRAME | ||
|
|
||
| def __init__(self, client, batch_size=100, response=None, **kwargs): | ||
| super().__init__( | ||
| client, batch_size=batch_size, response=response, **kwargs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.