luxonis / yolo2openvino Goto Github PK
View Code? Open in Web Editor NEWYoloV3, YoloV4, YoloV3-tiny, and YoloV4-tiny conversion to Tensorflow and OpenVINO.
License: MIT License
YoloV3, YoloV4, YoloV3-tiny, and YoloV4-tiny conversion to Tensorflow and OpenVINO.
License: MIT License
hello,
when i run like this:
python convert_weights_pb.py --yolo 4 --voc.data --output yolov4-duck.pb --weights_file /yolov4-tiny-duck_last.weights --size 416
and error occur!:
Traceback (most recent call last):
File "convert_weights_pb.py", line 94, in
tf.app.run()
File "/home//anaconda3/envs/change/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home//.local/lib/python3.6/site-packages/absl/app.py", line 303, in run
_run_main(main, args)
File "/home//.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "convert_weights_pb.py", line 78, in main
load_ops = load_weights(tf.global_variables(scope='detector'), FLAGS.weights_file)
File "/home//Documents/ceprei/yolo2openvino/utils/utils.py", line 113, in load_weights
(shape[3], shape[2], shape[0], shape[1]))
ValueError: cannot reshape array of size 372388 into shape (256,256,3,3)
how can i fix it?
thank you!
Hi, I have questions about anchors and mask. So in case of yolov4-tiny, the [yolo] layer in cfg file is
First yolo layer
[yolo]
mask = 3,4,5
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=1
num=6
jitter=.3
scale_x_y = 1.05
cls_normalizer=1.0
iou_normalizer=0.5
iou_loss=giou
ignore_thresh = .9
truth_thresh = 1
random=0
resize=1.5
nms_kind=greedynms
beta_nms=0.6
#new_coords=1
#scale_x_y = 2.0
Second yolo layer
[yolo]
mask = 1,2,3
anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319
classes=1
num=6
jitter=.3
scale_x_y = 1.05
cls_normalizer=1.0
iou_normalizer=0.5
iou_loss=giou
ignore_thresh = 0.9
truth_thresh = 1
random=1
resize=1.5
nms_kind=greedynms
beta_nms=0.6
max=200
#new_coords=1
#scale_x_y = 2.0
So as you explained about Anchors here, when I specify the argument on convert_weights_pb.py , I need to put it like this? -a 23,27,37,58,81,82,81,82,135,169,344,319
Because it uses 1,2,3 and 3,4,5 mask, so index 3 would be double?
Hi,
I'm using a darknet yolov4-custom model for detecting small objects modified according to this guide darknet-small-objects, which we plan to run on a depthAI device (we will later change to yolov4-tiny, also customized). However, I'm having troubles to adapt your code so I can convert to .pb format (Im following your colab guide to transform darknet to blob)
So far I understand a bit how your code works to transform darknet yolo to tensorflow .pb and I've managed to modify the code for custom classes, anchors and masks. However, one of the modifications made on my custom yolo was set layers = 23
instead of layers = 54
in the route before the firs yolo layer (L895 in custom .cfg). As I understand, this means that I have to replace up_route_54
in L100 and L102 with up_route_23
, but I do not know how to capture up_route_23
, any guide or idea?
I've also modified the stride = 2
to stride = 4
in the line just before the modified route. Do I have to change something else related to this stride?.
Thanks!
Add a simple demo for both, TF model and OpenVINO model.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.