detection ok
This commit is contained in:
parent
8635c7fd37
commit
6e8a6ab806
@ -2,4 +2,5 @@
|
||||
this: this
|
||||
mino: mino
|
||||
DESKTOP-VOCOB38: vm
|
||||
neodl-MS-7A62: neo-dl
|
||||
ST-RES-1: stres1
|
||||
7
config/machine_settings/neo-dl.ini
Normal file
7
config/machine_settings/neo-dl.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[tecna_t3]
|
||||
port: /dev/ttyUSB0
|
||||
|
||||
[neo_pixels]
|
||||
port: /dev/ttyACM0
|
||||
baudrate: 9600
|
||||
|
||||
@ -344,7 +344,9 @@ class Vision(Component):
|
||||
if self.interpreter is not None and frame.shape != self.interpreter.get_input_details()[0]["shape"][1:3]:
|
||||
tensor = np.expand_dims(cv2.resize(frame, self.interpreter.get_input_details()[0]["shape"][1:3], interpolation=cv2.INTER_LINEAR), axis=0)
|
||||
else:
|
||||
tensor = np.expand_dims(frame, axis=0)
|
||||
frame_resized=cv2.resize(frame, (256,256), interpolation=cv2.INTER_LINEAR)
|
||||
tensor = tf.convert_to_tensor(np.asarray(frame_resized))
|
||||
tensor = tensor[tf.newaxis, ...]
|
||||
# Run inference
|
||||
if lock:
|
||||
self.lock.lock()
|
||||
@ -391,10 +393,7 @@ class Vision(Component):
|
||||
"detection_classes": [map(lambda class_id: class_id + 1, class_ids)][0:1],
|
||||
}
|
||||
else:
|
||||
input_tensor = tf.convert_to_tensor(np.asarray(tensor))
|
||||
#input_tensor = input_tensor[tf.newaxis, ...]
|
||||
|
||||
detections = self.model(input_tensor)
|
||||
detections = self.model(tensor)
|
||||
if lock:
|
||||
self.lock.unlock()
|
||||
# WARNING: results other than the ones related to tensor[-1] will be discarded
|
||||
|
||||
0
src/test/detection.py
Normal file
0
src/test/detection.py
Normal file
Loading…
Reference in New Issue
Block a user