with a coffee
This commit is contained in:
1 parent
31b9e85912
commit
0f0fe0f518
7 files changed
+74
-41
No files matched your search
@@ -13,7 +13,9 @@ import pandera as pa
|
||||
class DataDumper(abc.ABC):
|
||||
|
||||
@abc.abstractmethod
|
||||
def write_boxes(self, obj: list[TrackedDetectedObject], ts: VideoTimestamp,
|
||||
def write_boxes(self,
|
||||
tracked_obj: pd.DataFrame,
|
||||
ts: VideoTimestamp,
|
||||
frame_index: int) -> None:
|
||||
pass
|
||||
|
||||
@@ -78,7 +80,7 @@ class SQLiteDataDumper(DataDumper):
|
||||
def start(self,
|
||||
video_path: Path,
|
||||
hexa_hash: str,
|
||||
metadata: VideoMetadata|None=None) -> None:
|
||||
metadata: VideoMetadata | None = None) -> None:
|
||||
self._create_tables()
|
||||
|
||||
cur = self._conn.cursor()
|
||||
@@ -110,7 +112,8 @@ class SQLiteDataDumper(DataDumper):
|
||||
RETURNING id
|
||||
''', (ts, frame_index, self._video_id))
|
||||
frame_id = res.fetchone()[0]
|
||||
cols = ['xmin', 'ymin', 'xmax', 'ymax', 'score', 'category', 'object_id']
|
||||
cols = ['xmin', 'ymin', 'xmax', 'ymax', 'score', 'category',
|
||||
'object_id']
|
||||
cur.executemany('''
|
||||
INSERT INTO tracked_detected_object(xmin,
|
||||
ymin,
|
||||
|
||||
Reference in new issue
Block a user