Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

Messed up multiple object detections all over the image

RGVGreatCoder
Novice
834 Views

Hello support,

I created the IR (xml,bin) files with the "mo" command and when I ran the object_detection_demo (c++) program it projected too many bounding boxes all over the image. Following is a snapshot of the image from the video:

RGVGreatCoder_0-1658513542195.png

 

Following are the steps I performed:

1). Ran the convert.py program:
> python keras-YOLOv3-model-set/tools/model_converter/convert.py <path>\yolov4-tiny-custom.cfg <path>\y4-manuel-cup-mug.weights <saved_model_ir>

python keras-YOLOv3-model-set/tools/model_converter/convert.py C:\Users\manue\source\repos\AI-Machine-Learning\Creating-YoloV4-tiny-model\Manuel\cup-mug\yolov4-tiny-custom.cfg C:\Users\manue\source\repos\AI-Machine-Learning\Creating-YoloV4-tiny-model\Manuel\cup-mug\produced-yolo-model\y4-manuel-cup-mug.weights C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug

2022-07-22 12:43:09.372762: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cudart64_110.dll
Loading weights.
Weights Header:  0 2 5 [172800]
Parsing Darknet config.
Creating Keras model.
Parsing section net_0
Parsing section convolutional_0
conv2d bn leaky (3, 3, 3, 32)
2022-07-22 12:43:11.372393: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary nvcuda.dll
2022-07-22 12:43:11.391041: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 computeCapability: 6.1
coreClock: 1.442GHz coreCount: 6 deviceMemorySize: 3.00GiB deviceMemoryBandwidth: 78.32GiB/s
2022-07-22 12:43:11.391216: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cudart64_110.dll
2022-07-22 12:43:11.409801: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cublas64_11.dll
2022-07-22 12:43:11.409932: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cublasLt64_11.dll
2022-07-22 12:43:11.419497: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cufft64_10.dll
2022-07-22 12:43:11.422566: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary curand64_10.dll
2022-07-22 12:43:11.427717: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cusolver64_11.dll
2022-07-22 12:43:11.433124: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cusparse64_11.dll
2022-07-22 12:43:11.434178: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic li
brary cudnn64_8.dll
2022-07-22 12:43:11.434601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0
2022-07-22 12:43:11.435522: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with
oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX
 AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-07-22 12:43:11.436973: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: NVIDIA GeForce GTX 1050 computeCapability: 6.1
coreClock: 1.442GHz coreCount: 6 deviceMemorySize: 3.00GiB deviceMemoryBandwidth: 78.32GiB/s
2022-07-22 12:43:11.437343: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0
2022-07-22 12:43:11.958893: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor wi
th strength 1 edge matrix:
2022-07-22 12:43:11.959008: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]      0
2022-07-22 12:43:11.959232: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0:   N
2022-07-22 12:43:11.959595: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:local
host/replica:0/task:0/device:GPU:0 with 1903 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce GTX 1050, pci bus
 id: 0000:01:00.0, compute capability: 6.1)
Parsing section convolutional_1
conv2d bn leaky (3, 3, 32, 64)
Parsing section convolutional_2
conv2d bn leaky (3, 3, 64, 64)
Parsing section route_0
Split KerasTensor(type_spec=TensorSpec(shape=(None, None, None, 64), dtype=tf.float32, name=None), name='leaky_re_lu_2/Lea
kyRelu:0', description="created by layer 'leaky_re_lu_2'") to 2 groups and pick id 1
Parsing section convolutional_3
conv2d bn leaky (3, 3, 32, 32)
Parsing section convolutional_4
conv2d bn leaky (3, 3, 32, 32)
Parsing section route_1
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 32) dtype=float32 (created by layer 'leaky_re_lu_4')>,
 <KerasTensor: shape=(None, None, None, 32) dtype=float32 (created by layer 'leaky_re_lu_3')>]
Parsing section convolutional_5
conv2d bn leaky (1, 1, 64, 64)
Parsing section route_2
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 64) dtype=float32 (created by layer 'leaky_re_lu_2')>,
 <KerasTensor: shape=(None, None, None, 64) dtype=float32 (created by layer 'leaky_re_lu_5')>]
Parsing section maxpool_0
Parsing section convolutional_6
conv2d bn leaky (3, 3, 128, 128)
Parsing section route_3
Split KerasTensor(type_spec=TensorSpec(shape=(None, None, None, 128), dtype=tf.float32, name=None), name='leaky_re_lu_6/Le
akyRelu:0', description="created by layer 'leaky_re_lu_6'") to 2 groups and pick id 1
Parsing section convolutional_7
conv2d bn leaky (3, 3, 64, 64)
Parsing section convolutional_8
conv2d bn leaky (3, 3, 64, 64)
Parsing section route_4
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 64) dtype=float32 (created by layer 'leaky_re_lu_8')>,
 <KerasTensor: shape=(None, None, None, 64) dtype=float32 (created by layer 'leaky_re_lu_7')>]
Parsing section convolutional_9
conv2d bn leaky (1, 1, 128, 128)
Parsing section route_5
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 128) dtype=float32 (created by layer 'leaky_re_lu_6')>
, <KerasTensor: shape=(None, None, None, 128) dtype=float32 (created by layer 'leaky_re_lu_9')>]
Parsing section maxpool_1
Parsing section convolutional_10
conv2d bn leaky (3, 3, 256, 256)
Parsing section route_6
Split KerasTensor(type_spec=TensorSpec(shape=(None, None, None, 256), dtype=tf.float32, name=None), name='leaky_re_lu_10/L
eakyRelu:0', description="created by layer 'leaky_re_lu_10'") to 2 groups and pick id 1
Parsing section convolutional_11
conv2d bn leaky (3, 3, 128, 128)
Parsing section convolutional_12
conv2d bn leaky (3, 3, 128, 128)
Parsing section route_7
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 128) dtype=float32 (created by layer 'leaky_re_lu_12')
>, <KerasTensor: shape=(None, None, None, 128) dtype=float32 (created by layer 'leaky_re_lu_11')>]
Parsing section convolutional_13
conv2d bn leaky (1, 1, 256, 256)
Parsing section route_8
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 256) dtype=float32 (created by layer 'leaky_re_lu_10')
>, <KerasTensor: shape=(None, None, None, 256) dtype=float32 (created by layer 'leaky_re_lu_13')>]
Parsing section maxpool_2
Parsing section convolutional_14
conv2d bn leaky (3, 3, 512, 512)
Parsing section convolutional_15
conv2d bn leaky (1, 1, 512, 256)
Parsing section convolutional_16
conv2d bn leaky (3, 3, 256, 512)
Parsing section convolutional_17
conv2d    linear (1, 1, 512, 21)
Parsing section yolo_0
Parsing section route_9
Parsing section convolutional_18
conv2d bn leaky (1, 1, 256, 128)
Parsing section upsample_0
Parsing section route_10
Concatenating route layers: [<KerasTensor: shape=(None, None, None, 128) dtype=float32 (created by layer 'up_sampling2d')>
, <KerasTensor: shape=(None, None, None, 256) dtype=float32 (created by layer 'leaky_re_lu_13')>]
Parsing section convolutional_19
conv2d bn leaky (3, 3, 384, 256)
Parsing section convolutional_20
conv2d    linear (1, 1, 256, 21)
Parsing section yolo_1
Model: "model"
__________________________________________________________________________________________________
Layer (type)                    Output Shape         Param #     Connected to
==================================================================================================
image_input (InputLayer)        [(None, None, None,  0
__________________________________________________________________________________________________
zero_padding2d (ZeroPadding2D)  (None, None, None, 3 0           image_input[0][0]
__________________________________________________________________________________________________
conv2d (Conv2D)                 (None, None, None, 3 864         zero_padding2d[0][0]
__________________________________________________________________________________________________
batch_normalization (BatchNorma (None, None, None, 3 128         conv2d[0][0]
__________________________________________________________________________________________________
leaky_re_lu (LeakyReLU)         (None, None, None, 3 0           batch_normalization[0][0]
__________________________________________________________________________________________________
zero_padding2d_1 (ZeroPadding2D (None, None, None, 3 0           leaky_re_lu[0][0]
__________________________________________________________________________________________________
conv2d_1 (Conv2D)               (None, None, None, 6 18432       zero_padding2d_1[0][0]
__________________________________________________________________________________________________
batch_normalization_1 (BatchNor (None, None, None, 6 256         conv2d_1[0][0]
__________________________________________________________________________________________________
leaky_re_lu_1 (LeakyReLU)       (None, None, None, 6 0           batch_normalization_1[0][0]
__________________________________________________________________________________________________
conv2d_2 (Conv2D)               (None, None, None, 6 36864       leaky_re_lu_1[0][0]
__________________________________________________________________________________________________
batch_normalization_2 (BatchNor (None, None, None, 6 256         conv2d_2[0][0]
__________________________________________________________________________________________________
leaky_re_lu_2 (LeakyReLU)       (None, None, None, 6 0           batch_normalization_2[0][0]
__________________________________________________________________________________________________
group_route_3 (Lambda)          (None, None, None, 3 0           leaky_re_lu_2[0][0]
__________________________________________________________________________________________________
conv2d_3 (Conv2D)               (None, None, None, 3 9216        group_route_3[0][0]
__________________________________________________________________________________________________
batch_normalization_3 (BatchNor (None, None, None, 3 128         conv2d_3[0][0]
__________________________________________________________________________________________________
leaky_re_lu_3 (LeakyReLU)       (None, None, None, 3 0           batch_normalization_3[0][0]
__________________________________________________________________________________________________
conv2d_4 (Conv2D)               (None, None, None, 3 9216        leaky_re_lu_3[0][0]
__________________________________________________________________________________________________
batch_normalization_4 (BatchNor (None, None, None, 3 128         conv2d_4[0][0]
__________________________________________________________________________________________________
leaky_re_lu_4 (LeakyReLU)       (None, None, None, 3 0           batch_normalization_4[0][0]
__________________________________________________________________________________________________
concatenate (Concatenate)       (None, None, None, 6 0           leaky_re_lu_4[0][0]
                                                                 leaky_re_lu_3[0][0]
__________________________________________________________________________________________________
conv2d_5 (Conv2D)               (None, None, None, 6 4096        concatenate[0][0]
__________________________________________________________________________________________________
batch_normalization_5 (BatchNor (None, None, None, 6 256         conv2d_5[0][0]
__________________________________________________________________________________________________
leaky_re_lu_5 (LeakyReLU)       (None, None, None, 6 0           batch_normalization_5[0][0]
__________________________________________________________________________________________________
concatenate_1 (Concatenate)     (None, None, None, 1 0           leaky_re_lu_2[0][0]
                                                                 leaky_re_lu_5[0][0]
__________________________________________________________________________________________________
max_pooling2d (MaxPooling2D)    (None, None, None, 1 0           concatenate_1[0][0]
__________________________________________________________________________________________________
conv2d_6 (Conv2D)               (None, None, None, 1 147456      max_pooling2d[0][0]
__________________________________________________________________________________________________
batch_normalization_6 (BatchNor (None, None, None, 1 512         conv2d_6[0][0]
__________________________________________________________________________________________________
leaky_re_lu_6 (LeakyReLU)       (None, None, None, 1 0           batch_normalization_6[0][0]
__________________________________________________________________________________________________
group_route_11 (Lambda)         (None, None, None, 6 0           leaky_re_lu_6[0][0]
__________________________________________________________________________________________________
conv2d_7 (Conv2D)               (None, None, None, 6 36864       group_route_11[0][0]
__________________________________________________________________________________________________
batch_normalization_7 (BatchNor (None, None, None, 6 256         conv2d_7[0][0]
__________________________________________________________________________________________________
leaky_re_lu_7 (LeakyReLU)       (None, None, None, 6 0           batch_normalization_7[0][0]
__________________________________________________________________________________________________
conv2d_8 (Conv2D)               (None, None, None, 6 36864       leaky_re_lu_7[0][0]
__________________________________________________________________________________________________
batch_normalization_8 (BatchNor (None, None, None, 6 256         conv2d_8[0][0]
__________________________________________________________________________________________________
leaky_re_lu_8 (LeakyReLU)       (None, None, None, 6 0           batch_normalization_8[0][0]
__________________________________________________________________________________________________
concatenate_2 (Concatenate)     (None, None, None, 1 0           leaky_re_lu_8[0][0]
                                                                 leaky_re_lu_7[0][0]
__________________________________________________________________________________________________
conv2d_9 (Conv2D)               (None, None, None, 1 16384       concatenate_2[0][0]
__________________________________________________________________________________________________
batch_normalization_9 (BatchNor (None, None, None, 1 512         conv2d_9[0][0]
__________________________________________________________________________________________________
leaky_re_lu_9 (LeakyReLU)       (None, None, None, 1 0           batch_normalization_9[0][0]
__________________________________________________________________________________________________
concatenate_3 (Concatenate)     (None, None, None, 2 0           leaky_re_lu_6[0][0]
                                                                 leaky_re_lu_9[0][0]
__________________________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D)  (None, None, None, 2 0           concatenate_3[0][0]
__________________________________________________________________________________________________
conv2d_10 (Conv2D)              (None, None, None, 2 589824      max_pooling2d_1[0][0]
__________________________________________________________________________________________________
batch_normalization_10 (BatchNo (None, None, None, 2 1024        conv2d_10[0][0]
__________________________________________________________________________________________________
leaky_re_lu_10 (LeakyReLU)      (None, None, None, 2 0           batch_normalization_10[0][0]
__________________________________________________________________________________________________
group_route_19 (Lambda)         (None, None, None, 1 0           leaky_re_lu_10[0][0]
__________________________________________________________________________________________________
conv2d_11 (Conv2D)              (None, None, None, 1 147456      group_route_19[0][0]
__________________________________________________________________________________________________
batch_normalization_11 (BatchNo (None, None, None, 1 512         conv2d_11[0][0]
__________________________________________________________________________________________________
leaky_re_lu_11 (LeakyReLU)      (None, None, None, 1 0           batch_normalization_11[0][0]
__________________________________________________________________________________________________
conv2d_12 (Conv2D)              (None, None, None, 1 147456      leaky_re_lu_11[0][0]
__________________________________________________________________________________________________
batch_normalization_12 (BatchNo (None, None, None, 1 512         conv2d_12[0][0]
__________________________________________________________________________________________________
leaky_re_lu_12 (LeakyReLU)      (None, None, None, 1 0           batch_normalization_12[0][0]
__________________________________________________________________________________________________
concatenate_4 (Concatenate)     (None, None, None, 2 0           leaky_re_lu_12[0][0]
                                                                 leaky_re_lu_11[0][0]
__________________________________________________________________________________________________
conv2d_13 (Conv2D)              (None, None, None, 2 65536       concatenate_4[0][0]
__________________________________________________________________________________________________
batch_normalization_13 (BatchNo (None, None, None, 2 1024        conv2d_13[0][0]
__________________________________________________________________________________________________
leaky_re_lu_13 (LeakyReLU)      (None, None, None, 2 0           batch_normalization_13[0][0]
__________________________________________________________________________________________________
concatenate_5 (Concatenate)     (None, None, None, 5 0           leaky_re_lu_10[0][0]
                                                                 leaky_re_lu_13[0][0]
__________________________________________________________________________________________________
max_pooling2d_2 (MaxPooling2D)  (None, None, None, 5 0           concatenate_5[0][0]
__________________________________________________________________________________________________
conv2d_14 (Conv2D)              (None, None, None, 5 2359296     max_pooling2d_2[0][0]
__________________________________________________________________________________________________
batch_normalization_14 (BatchNo (None, None, None, 5 2048        conv2d_14[0][0]
__________________________________________________________________________________________________
leaky_re_lu_14 (LeakyReLU)      (None, None, None, 5 0           batch_normalization_14[0][0]
__________________________________________________________________________________________________
conv2d_15 (Conv2D)              (None, None, None, 2 131072      leaky_re_lu_14[0][0]
__________________________________________________________________________________________________
batch_normalization_15 (BatchNo (None, None, None, 2 1024        conv2d_15[0][0]
__________________________________________________________________________________________________
leaky_re_lu_15 (LeakyReLU)      (None, None, None, 2 0           batch_normalization_15[0][0]
__________________________________________________________________________________________________
conv2d_18 (Conv2D)              (None, None, None, 1 32768       leaky_re_lu_15[0][0]
__________________________________________________________________________________________________
batch_normalization_17 (BatchNo (None, None, None, 1 512         conv2d_18[0][0]
__________________________________________________________________________________________________
leaky_re_lu_17 (LeakyReLU)      (None, None, None, 1 0           batch_normalization_17[0][0]
__________________________________________________________________________________________________
up_sampling2d (UpSampling2D)    (None, None, None, 1 0           leaky_re_lu_17[0][0]
__________________________________________________________________________________________________
concatenate_6 (Concatenate)     (None, None, None, 3 0           up_sampling2d[0][0]
                                                                 leaky_re_lu_13[0][0]
__________________________________________________________________________________________________
conv2d_16 (Conv2D)              (None, None, None, 5 1179648     leaky_re_lu_15[0][0]
__________________________________________________________________________________________________
conv2d_19 (Conv2D)              (None, None, None, 2 884736      concatenate_6[0][0]
__________________________________________________________________________________________________
batch_normalization_16 (BatchNo (None, None, None, 5 2048        conv2d_16[0][0]
__________________________________________________________________________________________________
batch_normalization_18 (BatchNo (None, None, None, 2 1024        conv2d_19[0][0]
__________________________________________________________________________________________________
leaky_re_lu_16 (LeakyReLU)      (None, None, None, 5 0           batch_normalization_16[0][0]
__________________________________________________________________________________________________
leaky_re_lu_18 (LeakyReLU)      (None, None, None, 2 0           batch_normalization_18[0][0]
__________________________________________________________________________________________________
conv2d_17 (Conv2D)              (None, None, None, 2 10773       leaky_re_lu_16[0][0]
__________________________________________________________________________________________________
conv2d_20 (Conv2D)              (None, None, None, 2 5397        leaky_re_lu_18[0][0]
==================================================================================================
Total params: 5,882,634
Trainable params: 5,876,426
Non-trainable params: 6,208
__________________________________________________________________________________________________
None
WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will
be empty until you train or evaluate the model.
2022-07-22 12:43:14.871304: W tensorflow/python/util/util.cc:348] Sets are not currently considered sequences, but this ma
y change in the future, so consider avoiding using them.
Saved Keras model to C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug
Read 5882634 of 5882634.0 from Darknet weights.
Saved anchors to C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug_anchors.txt

 2). Ran the Model Optimizer command:
> mo --data_type=FP16 --scale_values=[255,255,255] --input_shape [1,416,416,3] --reverse_input_channels --saved_model_dir <saved_model_ir> -o <path>\IR
-n OpenVINO-Model-Manuel-Cup-Mug-2022-07-22

mo --data_type=FP16 --scale_values=[255,255,255] --input_shape [1,416,416,3] --reverse_input_channels --saved_model_dir C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug -o C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR -n OpenVINO-Model-Manuel-Cup-Mug-2022-07-22

Model Optimizer arguments:
Common parameters:
	- Path to the Input Model: 	None
	- Path for generated IR: 	C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR
	- IR output name: 	OpenVINO-Model-Manuel-Cup-Mug-2022-07-22
	- Log level: 	ERROR
	- Batch: 	Not specified, inherited from the model
	- Input layers: 	Not specified, inherited from the model
	- Output layers: 	Not specified, inherited from the model
	- Input shapes: 	[1,416,416,3]
	- Source layout: 	Not specified
	- Target layout: 	Not specified
	- Layout: 	Not specified
	- Mean values: 	Not specified
	- Scale values: 	[255,255,255]
	- Scale factor: 	Not specified
	- Precision of IR: 	FP16
	- Enable fusing: 	True
	- User transformations: 	Not specified
	- Reverse input channels: 	True
	- Enable IR generation for fixed input shape: 	False
	- Use the transformations config file: 	None
Advanced parameters:
	- Force the usage of legacy Frontend of Model Optimizer for model conversion into IR: 	False
	- Force the usage of new Frontend of Model Optimizer for model conversion into IR: 	False
TensorFlow specific parameters:
	- Input model in text protobuf format: 	False
	- Path to model dump for TensorBoard: 	None
	- List of shared libraries with TensorFlow custom layers implementation: 	None
	- Update the configuration file with input/output node names: 	None
	- Use configuration file used to generate the model with Object Detection API: 	None
	- Use the config file: 	None
OpenVINO runtime found in: 	C:\Users\manue\AppData\Local\Programs\Python\Python39\lib\site-packages\openvino
OpenVINO runtime version: 	2022.1.0-7019-cdb9bec7210-releases/2022/1
Model Optimizer version: 	2022.1.0-7019-cdb9bec7210-releases/2022/1
[ SUCCESS ] Generated IR version 11 model.
[ SUCCESS ] XML file: C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR\OpenVINO-Model-Manuel-Cup-Mug-2022-07-22.xml
[ SUCCESS ] BIN file: C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR\OpenVINO-Model-Manuel-Cup-Mug-2022-07-22.bin
[ SUCCESS ] Total execution time: 18.38 seconds. 
It's been a while, check for a new version of Intel(R) Distribution of OpenVINO(TM) toolkit here https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html?cid=other&source=prod&campid=ww_2022_bu_IOTG_OpenVINO-2022-1&content=upg_all&medium=organic or on the GitHub*
[ INFO ] The model was converted to IR v11, the latest model format that corresponds to the source DL framework input/output format. While IR v11 is backwards compatible with OpenVINO Inference Engine API v1.0, please use API v2.0 (as of 2022.1) to take advantage of the latest improvements in IR v11.
Find more information about API v2.0 and IR v11 at https://docs.openvino.ai

3) Ran "setupvars.bat" and "object_detection_demo.exe" as follows:

C:\Users\manue\source\repos\AI-Machine-Learning\omzoo_demos\intel64\Debug>"C:\Program Files (x86)\Intel\openvino_2022.1.0.
643\setupvars.bat"
Python 3.9.13
[setupvars.bat] OpenVINO environment initialized

C:\Users\manue\source\repos\AI-Machine-Learning\omzoo_demos\intel64\Debug>object_detection_demo -i "C:\Users\manue\source\
repos\AI-Machine-Learning\Creating-YoloV4-tiny-model\Manuel\cup-mug-dish\test\dish-2cups.mp4" -m "C:\Users\manue\source\re
pos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR\OpenVINO-Model-Manuel-Cup-Mug-2022-07-22.xml" -labels "C:\Users\manue\s
ource\repos\AI-Machine-Learning\Creating-YoloV4-tiny-model\Manuel\cup-mug\obj\classes.txt"
[ INFO:0@0.010] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\videoio_registry.cpp (223) cv::`ano
nymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Enabled backends(8, sorted by priority): FFMPEG(100
0); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930)
[ INFO:0@0.010] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (383) cv::impl::
getPluginCandidates Found 3 plugin(s) for FFMPEG
[ INFO:0@0.011] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load C:\Program Files (x86)\Intel\openvino_2022.1.0.643\extras\opencv\bin\opencv_vid
eoio_ffmpeg455_64d.dll => FAILED
[ INFO:0@0.012] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load opencv_videoio_ffmpeg455_64d.dll => FAILED
[ INFO:0@0.017] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load opencv_videoio_ffmpeg455_64.dll => OK
[ INFO:0@0.018] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (50) cv::impl::P
luginBackend::initCaptureAPI Found entry: 'opencv_videoio_capture_plugin_init_v1'
[ INFO:0@0.018] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (169) cv::impl::
PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Capture plugin': built with OpenCV 4.5 (
ABI/API = 1/1), current OpenCV version is '4.5.5-openvino' (ABI/API = 1/1)
[ INFO:0@0.018] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (69) cv::impl::P
luginBackend::initCaptureAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Capture plugin'
[ INFO:0@0.018] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (84) cv::impl::P
luginBackend::initWriterAPI Found entry: 'opencv_videoio_writer_plugin_init_v1'
[ INFO:0@0.019] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (169) cv::impl::
PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Writer plugin': built with OpenCV 4.5 (A
BI/API = 1/1), current OpenCV version is '4.5.5-openvino' (ABI/API = 1/1)
[ INFO:0@0.019] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\videoio\src\backend_plugin.cpp (103) cv::impl::
PluginBackend::initWriterAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Writer plugin'
STARTING NEW DETECTION.........
[ INFO ] OpenVINO
[ INFO ]        version: 2022.1.0
[ INFO ]        build: 2022.1.0-7019-cdb9bec7210-releases/2022/1
[ INFO ] Reading model C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR\OpenVINO-Model-Manuel-Cu
p-Mug-2022-07-22.xml
[ INFO ] Model name: OpenVINO-Model-Manuel-Cup-Mug-2022-07-22
[ INFO ]        Inputs:
[ INFO ]                image_input, f32, {1,416,416,3}, [...]
[ INFO ]        Outputs:
[ INFO ]                Func/StatefulPartitionedCall/output/_100:0, f32, {1,13,13,21}, [...]
[ INFO ]                Func/StatefulPartitionedCall/output/_101:0, f32, {1,26,26,21}, [...]
[ WARNING ] Automatically detected layout '[N,H,W,C]' for input 'image_input' will be used.
[ INFO ] The model C:\Users\manue\source\repos\AI-Machine-Learning\OpenVINO-Models\cup-mug\IR\OpenVINO-Model-Manuel-Cup-Mu
g-2022-07-22.xml is loaded to GPU
[ INFO ]        Device: GPU
[ INFO ]                Number of streams: 2
[ INFO ]        Number of inference requests: 5
[ INFO:0@7.587] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\parallel\registry_parallel.impl.hpp (9
6) cv::parallel::ParallelBackendRegistry::ParallelBackendRegistry core(parallel): Enabled backends(3, sorted by priority):
 ONETBB(1000); TBB(990); OPENMP(980)
[ INFO:0@7.588] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load C:\Program Files (x86)\Intel\openvino_2022.1.0.643\extras\opencv\bin\opencv_cor
e_parallel_onetbb455_64d.dll => FAILED
[ INFO:0@7.589] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load opencv_core_parallel_onetbb455_64d.dll => FAILED
[ INFO:0@7.592] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\utils\plugin_loader.impl.hpp (67) cv::
plugin::impl::DynamicLib::libraryLoad load C:\Program Files (x86)\Intel\openvino_2022.1.0.643\extras\opencv\bin\opencv_cor
e_parallel_tbb455_64d.dll => OK
[ INFO:0@7.593] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\parallel\plugin_parallel_wrapper.impl.
hpp (48) cv::impl::PluginParallelBackend::initPluginAPI core(parallel): plugin is ready to use 'TBB (interface 9107) OpenC
V parallel plugin'
[ INFO:0@7.593] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\include\opencv2/core/parallel/backend/para
llel_for.tbb.hpp (54) cv::parallel::tbb::ParallelForBackend::ParallelForBackend Initializing TBB parallel backend: TBB_INT
ERFACE_VERSION=9107
[ INFO:0@7.593] global C:\jenkins\workspace\windows9f26d2f1\opencv\modules\core\src\parallel\parallel.cpp (77) cv::paralle
l::createParallelForAPI core(parallel): using backend: TBB (priority=990)
cup(0.52562)
cup(0.586836)
cup(0.534849)
...
^C

I run a PC with Windows 11 and openvino 2022.1.0 (I installed both: downloading the runtime offline installer and "pip install openvino-dev[onnx,tensorflow2]==2022.1.0")

However, I still have the IR (xml,bin) files generated with the previous openvino version and these still work well with the same object_detection_demo c++ program.

Why am I getting multiple messed up detections all over the image? What am I doing wrong? How can I fix this issue?

Note: I am attaching a compressed file so you may reproduce this issue on your end (I will appreciate!). 

Thank you and will be waiting for your reply,

0 Kudos
7 Replies
Wan_Intel
Moderator
805 Views

Hi RGVGreatCoder,

Thanks for reaching out to us.

 

For your information, I’ve tested your model with Object Detection Python Demo using your video files. The command I used to execute the demo is:

python object_detection_demo.py -at yolov4 --labels classes.txt -m OpenVINO-Model-Manuel-Cup-Mug-2022-07-22.xml --loop -i dish-cup-mug.mp4

 

The inference result is shown as follows:

result.png

 

I noticed that you didn’t use -at when running the inference. Could you please add -at yolov4 when running the demo add see if the bug is able to resolve?

 

 

Regards,

Wan

 

0 Kudos
RGVGreatCoder
Novice
791 Views

We don't want anything to do with Python (despite it works with Python). We need for it to work with the C++ demo program (notice I did specify C++ in my message).

Are there additional programs to be installed besides the Openvino offline runtime installer (w_openvino_toolkit_p_2022.1.0.643_offline.exe) and through PIP (pip install openvino-dev[onnx,tensorflow2]==2022.1.0) to have the Object_detection.exe C++ work? For example, I noticed the following message when running the model optimizer "mo..." :

...
It's been a while, check for a new version of Intel(R) Distribution of OpenVINO(TM) toolkit here https://software.intel.com/content/www/us/en/develop/tools/openvino-toolkit/download.html?cid=other&source=prod&campid=ww_2022_bu_IOTG_OpenVINO-2022-1&content=upg_all&medium=organic or on the GitHub*
[ INFO ] The model was converted to IR v11, the latest model format that corresponds to the source DL framework input/output format. While IR v11 is backwards compatible with OpenVINO Inference Engine API v1.0, please use API v2.0 (as of 2022.1) to take advantage of the latest improvements in IR v11.
Find more information about API v2.0 and IR v11 at https://docs.openvino.ai

Specifically: "...While IR v11 is backwards compatible with OpenVINO Inference Engine API v1.0, please use API v2.0 (as of 2022.1) to take advantage of the latest improvements in IR v11."

Why is it saying I need to install API V2.0 when I installed the latest version of OpenVINO already? What am I missing? Could this be the reason why the object_detection_demo.exe C++ is not working?

Can you please help with letting me know how to make the object_detection_demo.exe C++ program version work?

Thank you and will be waiting for your reply,

0 Kudos
Wan_Intel
Moderator
781 Views

Hi RGVGreatCoder,

I encountered the same error when running Object Detection C++ Demo with your model and yolo-v4-tiny-tf.

failed.png

 

Meanwhile, the inference result is correct when running Object Detection Python Demo with your model and yolo-v4-tiny-tf.

ok.png

 

We’ll have an internal discussion with the next level to further investigate this issue.

 

On another note, I noticed that there is a difference between the public pre-trained yolo-v4-tiny-tf model and your custom model as shown as follows:

different_in_bias.png

 

Could you please explain the reason for such changes?

 

 

Regards,

Wan

 

0 Kudos
RGVGreatCoder
Novice
752 Views

I am not familiar in any way with the two charts you display in your comment above. And the differences I seem to find, between both charts are in the [Conv2D->conv2d_17] and [Conv2->conv2d_20] boxes. Specifically, my custom Conv2 Kernel and bias both end with 21 while in the public Conv2 both end with 255.

The explanation I can provide (if it can make any sense) is, the 21 value may possibly come from the "yolov4-tiny-custom.cfg" configuration file used when training the YoloV4 model. The filters in the last [convolutional] before each of the two [yolo] layers were set to 21, after following this formula: 
(classes + 5) x 3. In my case: (2 + 5) x 3 = 21

I created the Yolov4-tiny model following this link:
https://techzizou.com/train-a-custom-yolov4-tiny-object-detector-using-google-colab-tutorial-for-beginners/ 

But the Yolov4-tiny model works in my Python and C++ programs using OpenCV (without OpenVINO). Except, the FPS are slow.

When creating the OpenVINO IR model, the IR model works on the object_detection_demo-Python program; however, does not work on the object_detection_demo-C++ program.

Interesting enough, the IR model I created from another Yolov4-tiny model in OpenVINO 2021 did work on the object_detection_demo-C++ program. So I wonder what could have changed in OpenVINO 2022 or perhaps I am missing to update or install another OpenVINO program. 

Thank you and, I will be waiting for your solution to this issue.

Wan_Intel
Moderator
729 Views

Hi RGVGreatCoder,

Thanks for reporting this bug.

 

I’ve escalated it to our development team to verify if this is a bug or not. Please expect some delay from our development side and we’ll get back to you as soon as possible.

 

 

Regards,

Wan


0 Kudos
Wan_Intel
Moderator
567 Views

Hi RGVGreatCoder,

Thanks for your patience.

 

This issue has been resolved in OpenVINO™ toolkit 2022.2. You may git clone Open Model Zoo 2022.2.0 with the following command:

git clone --recurse-submodules --depth 1 --branch 2022.2.0 https://github.com/openvinotoolkit/open_model_zoo.git

 ok.png

 

Regards,

Wan

 

0 Kudos
Wan_Intel
Moderator
550 Views

Hi RGVGreatCoder,

Thanks for your question.

This thread will no longer be monitored since we have provided information. 

If you need any additional information from Intel, please submit a new question.

 

 

Best regards,

Wan

 

0 Kudos
Reply