mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Removed unnecesarry comments, improved documentation, addressed PR items
This commit is contained in:
parent
bf934a7651
commit
a3bd13b7ea
@ -116,7 +116,6 @@ model:
|
|||||||
height: 300
|
height: 300
|
||||||
input_tensor: nhwc
|
input_tensor: nhwc
|
||||||
input_pixel_format: bgr
|
input_pixel_format: bgr
|
||||||
model_type: ssd
|
|
||||||
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
|
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -128,7 +127,7 @@ detectors:
|
|||||||
type: openvino
|
type: openvino
|
||||||
device: AUTO
|
device: AUTO
|
||||||
model:
|
model:
|
||||||
path: /<path>/<to>/yolox_tiny.xml
|
path: /path/to/yolox_tiny.xml
|
||||||
|
|
||||||
model:
|
model:
|
||||||
width: 416
|
width: 416
|
||||||
@ -136,7 +135,7 @@ model:
|
|||||||
input_tensor: nchw
|
input_tensor: nchw
|
||||||
input_pixel_format: bgr
|
input_pixel_format: bgr
|
||||||
model_type: yolox
|
model_type: yolox
|
||||||
labelmap_path: /<path>/<to>/coco_80cl.txt
|
labelmap_path: /path/to/coco_80cl.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Intel NCS2 VPU and Myriad X Setup
|
### Intel NCS2 VPU and Myriad X Setup
|
||||||
|
|||||||
@ -105,6 +105,9 @@ model:
|
|||||||
# Optional: Object detection model input tensor format
|
# Optional: Object detection model input tensor format
|
||||||
# Valid values are nhwc or nchw (default: shown below)
|
# Valid values are nhwc or nchw (default: shown below)
|
||||||
input_tensor: nhwc
|
input_tensor: nhwc
|
||||||
|
# Optional: Object detection model type, currently only used with the OpenVINO detector
|
||||||
|
# Valid values are ssd or yolox (default: shown below)
|
||||||
|
model_type: ssd
|
||||||
# Optional: Label name modifications. These are merged into the standard labelmap.
|
# Optional: Label name modifications. These are merged into the standard labelmap.
|
||||||
labelmap:
|
labelmap:
|
||||||
2: vehicle
|
2: vehicle
|
||||||
|
|||||||
@ -39,7 +39,6 @@ class OvDetector(DetectionApi):
|
|||||||
try:
|
try:
|
||||||
tensor_shape = self.interpreter.output(self.output_indexes).shape
|
tensor_shape = self.interpreter.output(self.output_indexes).shape
|
||||||
logger.info(f"Model Output-{self.output_indexes} Shape: {tensor_shape}")
|
logger.info(f"Model Output-{self.output_indexes} Shape: {tensor_shape}")
|
||||||
logger.info(f"Model Output-{self.output_indexes} Shape: {tensor_shape}")
|
|
||||||
self.output_indexes += 1
|
self.output_indexes += 1
|
||||||
except:
|
except:
|
||||||
logger.info(f"Model has {self.output_indexes} Output Tensors")
|
logger.info(f"Model has {self.output_indexes} Output Tensors")
|
||||||
@ -93,9 +92,9 @@ class OvDetector(DetectionApi):
|
|||||||
]
|
]
|
||||||
i += 1
|
i += 1
|
||||||
return detections
|
return detections
|
||||||
|
|
||||||
elif(self.ov_model_type == ModelTypeEnum.yolox):
|
elif(self.ov_model_type == ModelTypeEnum.yolox):
|
||||||
out_tensor = infer_request.get_output_tensor()
|
out_tensor = infer_request.get_output_tensor()
|
||||||
|
# [x, y, h, w, box_score, class_no_1, ..., class_no_80],
|
||||||
results = out_tensor.data
|
results = out_tensor.data
|
||||||
results[..., :2] = (results[..., :2] + self.grids) * self.expanded_strides
|
results[..., :2] = (results[..., :2] + self.grids) * self.expanded_strides
|
||||||
results[..., 2:4] = np.exp(results[..., 2:4]) * self.expanded_strides
|
results[..., 2:4] = np.exp(results[..., 2:4]) * self.expanded_strides
|
||||||
@ -117,7 +116,6 @@ class OvDetector(DetectionApi):
|
|||||||
|
|
||||||
for object_detected in ordered:
|
for object_detected in ordered:
|
||||||
if i < 20:
|
if i < 20:
|
||||||
# [x, y, h, w, box_score, class_no_1, ..., class_no_80],
|
|
||||||
detections[i] = [
|
detections[i] = [
|
||||||
object_detected[6], # Label ID
|
object_detected[6], # Label ID
|
||||||
object_detected[5], # Confidence
|
object_detected[5], # Confidence
|
||||||
@ -126,8 +124,6 @@ class OvDetector(DetectionApi):
|
|||||||
(object_detected[1]+(object_detected[3]/2))/self.h, # y_max
|
(object_detected[1]+(object_detected[3]/2))/self.h, # y_max
|
||||||
(object_detected[0]+(object_detected[2]/2))/self.w, # x_max
|
(object_detected[0]+(object_detected[2]/2))/self.w, # x_max
|
||||||
]
|
]
|
||||||
#logger.info(object_detected)
|
|
||||||
#logger.info(detections[i])
|
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user