compressai_vision.compressai_vision.pipelines.fo_vcm.fo#
fiftyone#
- compressai_vision.pipelines.fo_vcm.fo.predict.annexPredictions(predictors: list | None = None, fo_dataset: Dataset | None = None, gt_field: str = 'detections', predictor_fields: list | None = None, encoder_decoder=None, use_pb: bool = False, use_print: int = 1)[source]#
Run detector and EncoderDecoder instance on a dataset. Append detector results and bits-per-pixel to each sample.
- Parameters:
predictors – A list of Detectron2 predictor. It can be a single element list for a single task or multiple elements for multi-task scenario
fo_dataset – Fiftyone dataset
gt_field – Which dataset member to use for ground truths. Default: “detections”
predictor_fields – Which dataset member to use for saving the Detectron2 results. Default: “detectron-predictions”. It also can be a list when evaluating multiple vision tasks.
encoder_decoder – (optional) a
compressai_vision.evaluation.pipeline.EncoderDecoder
subclass instance to apply on the image before detectionuse_pb – Show progressbar or not. Nice for interactive runs, not so much for batch jobs. Default: False.
use_print – Print progress at every n:th. step. Default: 0 = no printing.
- compressai_vision.pipelines.fo_vcm.fo.predict.annexVideoPredictions(predictors: list | None = None, fo_dataset: Dataset | None = None, gt_field: str = 'detections', predictor_fields: list | None = None, encoder_decoder=None, use_pb: bool = False, use_print: int = 1)[source]#
Run detector and EncoderDecoder instance on a dataset. Append detector results and bits-per-pixel to each sample.
Dataset.Sample.Frames
- Parameters:
predictors – A list of Detectron2 predictor. It can be a single element list for a single task or multiple elements for multi-task scenario
fo_dataset – A fiftyone video dataset
gt_field – Which dataset member to use for ground truths. Default: “detections”
predictor_fields – Which dataset member to use for saving the Detectron2 results. Default: “detectron-predictions”. It also can be a list when evaluating multiple vision tasks.
encoder_decoder – (optional) a
compressai_vision.evaluation.pipeline.EncoderDecoder
subclass instance to apply on the image before detectionuse_pb – Show progressbar or not. Nice for interactive runs, not so much for batch jobs. Default: False.
use_print – Print progress at every n:th. step. Default: 0 = no printing.
Video datasets look like this:
Name: sfu-hw-objects-v1 Media type: video Num samples: 1 Persistent: True Tags: [] Sample fields: id: fiftyone.core.fields.ObjectIdField filepath: fiftyone.core.fields.StringField tags: fiftyone.core.fields.ListField(fiftyone.core.fields.StringField) metadata: fiftyone.core.fields.EmbeddedDocumentField(fiftyone.core.metadata.VideoMetadata) media_type: fiftyone.core.fields.StringField class_tag: fiftyone.core.fields.StringField name_tag: fiftyone.core.fields.StringField Frame fields: id: fiftyone.core.fields.ObjectIdField frame_number: fiftyone.core.fields.FrameNumberField detections: fiftyone.core.fields.EmbeddedDocumentField(fiftyone.core.labels.Detections)
Difference between image & video datasets
Image dataset:
Dataset first() __index__() iterator --> return Sample objects fields: id, filepath, ground-truths, detections, etc.
Video dataset
Dataset first() __index__ iterator --> return Sample objects fields: id, filepath frames: Frames object --> __index__ iterator --> returns Frame object fields: id, ground-truths, detections, etc.