VideoDataCSV
VideoDataCSV
VideoDataCSV(filename: str, check_video: bool = True, **kwargs)
Bases: CSVParser
ApertureDB Video Data.
This class loads the Video Data which is present in a CSV file, and converts it into a series of ApertureDB queries.
Note
Is backed by a CSV file with the following columns:
filename,PROP_NAME_1, ...PROP_NAME_N,constraint_PROP1,formatOR
url,PROP_NAME_1, ...PROP_NAME_N,constraint_PROP1,formatOR
s3_url,PROP_NAME_1, ...PROP_NAME_N,constraint_PROP1,formatOR
gs_url,PROP_NAME_1, ...PROP_NAME_N,constraint_PROP1,format
Example CSV file::
filename,id,label,constraint_id
/home/user/file1.mp4,321423532,dog,321423532
/home/user/file2.mp4,42342522,cat,4234252
...
Example usage:
data = VideoDataCSV("/path/to/VideoData.csv")
loader = ParallelLoader(client)
loader.ingest(data)
or
adb ingest from-csv /path/to/VideoData.csv --ingest-type VIDEO
Info
In the above example, the constraint_id ensures that an Video with the specified id would be only inserted if it does not already exist in the database.