We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I have trained on single-channel images YOLOv4 TIny .weights file
Then I got frozen_darknet_yolov4_model.pb file of this model with use follow command:
frozen_darknet_yolov4_model.pb
python .\convert_weights_pb.py --class_names "D:\Repositories\isocontainercodes-training\pipeline\yolo\names.list" --weights_file "D:\Repositories\isocontainercodes-training\pipeline\yolo\yolov4-tiny-mixed_y8-v3.weights" --data_format NHWC --tiny
Before that, I changed the line in convert_weights_pb.py so that there were not 3 channels, but 1:
# placeholder for detector inputs inputs = tf.placeholder(tf.float32, [None, FLAGS.size, FLAGS.size, 1], "inputs")
Then I got .bin and .xml files of OpenVINO IR model with use following command:
"C:\Program Files (x86)\Intel\openvino_2021.4.582\deployment_tools\model_optimize\mo.py" --input_model .\frozen_darknet_yolov4_model.pb --transformations_config .\yolo_v4_tiny.json --batch 1 --reverse_input_channels
When I tried to run inference:
python .\pythondemo\2021.3\object_detection_demo_yolov3_async.py -i "C:\Users\Reutov\Desktop\test_nmtp_video_4.mp4" -m .\frozen_darknet_yolov4_model.xml -d CPU
I got this:
Before that I changed code of object_detection_demo_yolov3_async.py:
object_detection_demo_yolov3_async.py
def resize(image, size, keep_aspect_ratio, interpolation=cv2.INTER_LINEAR): if not keep_aspect_ratio: return cv2.resize(cv2.cvtColor(image, cv2.COLOR_BGR2GRAY), size, interpolation=interpolation) iw, ih = image.shape[0:2][::-1] w, h = size scale = min(w/iw, h/ih) nw = int(iw*scale) nh = int(ih*scale) image = cv2.resize(cv2.cvtColor(image, cv2.COLOR_BGR2GRAY), (nw, nh), interpolation=interpolation) new_image = np.full((size[1], size[0], 3), 128, dtype=np.uint8) dx = (w-nw)//2 dy = (h-nh)//2 new_image[dy:dy+nh, dx:dx+nw, :] = image return new_image
# Read and pre-process input images if net.input_info[input_blob].input_data.shape[1] == 3: input_height, input_width = net.input_info[input_blob].input_data.shape[2:] nchw_shape = True else: input_height, input_width = net.input_info[input_blob].input_data.shape[2:] nchw_shape = False
.weights model YOLOv4 Tiny works in darknet normally:
What should I do to make the YOLOv4 Tiny single-channel model give correct detections using OpenVINO? Thanks in advance
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi!
I have trained on single-channel images YOLOv4 TIny .weights file
Then I got
frozen_darknet_yolov4_model.pb
file of this model with use follow command:Before that, I changed the line in convert_weights_pb.py so that there were not 3 channels, but 1:
Then I got .bin and .xml files of OpenVINO IR model with use following command:
When I tried to run inference:
I got this:
Before that I changed code of
object_detection_demo_yolov3_async.py
:.weights model YOLOv4 Tiny works in darknet normally:
What should I do to make the YOLOv4 Tiny single-channel model give correct detections using OpenVINO?
Thanks in advance
The text was updated successfully, but these errors were encountered: