updates
This commit is contained in:
@@ -68,13 +68,14 @@ def main():
|
||||
spec.neuralNetwork.preprocessing[0].featureName = '0'
|
||||
|
||||
yolov3_model.save(name + '.mlmodel')
|
||||
# yolov3_model.visualize_spec()
|
||||
print(spec.description)
|
||||
|
||||
# 2.5. Try to Predict:
|
||||
from PIL import Image
|
||||
img = Image.open('../yolov3/data/samples/zidane_416.jpg')
|
||||
out = yolov3_model.predict({'0': img})
|
||||
print(out['141'].shape, out['143'].shape)
|
||||
out = yolov3_model.predict({'0': img}, useCPUOnly=True)
|
||||
print(out['148'].shape, out['150'].shape)
|
||||
|
||||
# 3. Create NMS protobuf
|
||||
import numpy as np
|
||||
@@ -106,15 +107,15 @@ def main():
|
||||
del ma_type.shape[:]
|
||||
|
||||
nms = nms_spec.nonMaximumSuppression
|
||||
nms.confidenceInputFeatureName = '141' # 1x507x80
|
||||
nms.coordinatesInputFeatureName = '143' # 1x507x4
|
||||
nms.confidenceInputFeatureName = '148' # 1x507x80
|
||||
nms.coordinatesInputFeatureName = '150' # 1x507x4
|
||||
nms.confidenceOutputFeatureName = 'confidence'
|
||||
nms.coordinatesOutputFeatureName = 'coordinates'
|
||||
nms.iouThresholdInputFeatureName = 'iouThreshold'
|
||||
nms.confidenceThresholdInputFeatureName = 'confidenceThreshold'
|
||||
|
||||
nms.iouThreshold = 0.6
|
||||
nms.confidenceThreshold = 0.9
|
||||
nms.confidenceThreshold = 0.3
|
||||
nms.pickTop.perClass = True
|
||||
|
||||
labels = np.loadtxt('../yolov3/data/coco.names', dtype=str, delimiter='\n')
|
||||
|
||||
Reference in New Issue
Block a user