Detection Utils

Utils modules used for detection

class eyewitness.detection_utils.DetectionResult(image_dict)

Bases: object

represent detection result of a image.

Parameters:image_dict (dict) --
  • detection_method: detection_method str
  • detected_objects: List[tuple], list of detected obj (optional)
  • drawn_image_path: str, path of drawn image (optional)
  • image_id: image_id obj
detected_objects

List of detected objects in the image

Type:List[object]
drawn_image_path

drawn_image_path

Type:str
classmethod from_json(json_str)
image_id

image_id obj

Type:ImageId
to_json_dict()
Returns:image_dict -- the dict repsentation of detection_result
Return type:dict
class eyewitness.detection_utils.DetectionResultHandler

Bases: object

a abstract class design to handle detection result need to implement:

  • function: _handle(self, detection_result)
  • property: detection_method
detection_method
handle(detection_result)

wrapper of _handle function with the check of detection_method with detection_result.

Parameters:detection_result (DetectionResult) --