Length Aggregators¶
Aggregate frame level information to estimate shot length.
The aggregator functions here takes detected faces and objects to estimate the shot length. It also provides aggregated information about the detected faces and objects for each frame.
-
class
dvt.aggregate.length.ShotLengthAggregator(**kwargs)[source]¶ Bases:
dvt.abstract.AggregatorUses detected faces and objects to estimate shot length.
You can change the cut-offs and names of the face types.
-
min_obj_score¶ minimum confidence score to include a detected object in the computation
Type: float
-
min_face_score¶ minimum confidence score to include a detected face in the computation
Type: float
-
max_person_dist¶ maximum distance to a face to categorize as a known person.
Type: float
-
shot_names¶ a list of shot names, from the longest shot to the tightest. Set to None to use the default settings.
Type: list
-
shot_sizes¶ as list of shot size cut-offs given as a proportion (vertical) of face size to the entire shot. Should be an increasing list starting at zero and the same length as shot_names. Set to None to use the default settings.
Type: list
-
name¶ A description of the aggregator. Used as a key in the output data.
Type: str
-
aggregate(ldframe, **kwargs)[source]¶ Determine shot lengths using detected faces and objects.
Parameters: - ldframe (dict) – A dictionary of DictFrames from a FrameAnnotator. Must contain an entry with the keys ‘meta’, ‘face’ and ‘obj’, which are used in the annotation.
- frames (list) – An optional list of frames. Otherwise, will annotate any frame with a detected face or object.
Returns: A dictionary frame giving the detected people, with one row per frame in the original input.
-
name= 'length'
-