Issue 1:
System information (version)

OpenCV => 3.4.5 / 4.0.0 / 4.0.1

Operating System / Platform => Ubuntu 16

Compiler => g++

Python => 3.6.8

Detailed description

I compiled the open-cv with gstreamer support, and I tried to freeze my python codes with cx_freeze / pyinstaller. It prompt success whild freezing. But when I try to run the binary file, it prompted as follow:

File "/usr/local/lib/python3.6/site-packages/cx_Freeze/initscripts/__startup__.py", line 14, in run
module.run()
File "/usr/local/lib/python3.6/site-packages/cx_Freeze/initscripts/Console.py", line 26, in run
exec(code, m.__dict__)
File "/tmp/tmpe6jo_q_3/scripts/my_own_scripts.py", line 14, in <module>
File "/usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 89, in <module>
bootstrap()
File "/usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 58, in bootstrap
load_first_config(['config.py'], True)
File "/usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 56, in load_first_config
raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
ImportError: OpenCV loader: missing configuration file: ['config.py']. Check OpenCV installation.

This error is not existed if I use open-cv with

pip install opencv-python

However, I need the gstream support for open-cv, so I have to compile it myself.

Please help me to check whether it is a bug or not. Thank you

Lanny

Steps to reproduce

compile opencv as guided

compose a python scripts to include opencv

import cv2

if __name__ == '__main__':
print("Hello, world!")

freeze it with cx_freeze of pyinstaller

execute the binay.

Issue 2:
System information (version)

OpenCV => 4.3.0

Detailed description

History of the region layer:

YOLOv2 added in #9705. YOLOv2 detected objects at one scale; hence, there is just one region layer. The region layer would output unfiltered detections. The obvious step after region layer was to perform NMS. Hence, NMS was presumably integrated into the region layer.

YOLOv3 support was added in #11322. The improved YOLOv3 was detecting objects at three different scales. Each scale had a separate yolo layer in darknet and NMS was performed on all the detections at the end. The #11322 creates a region layer for each yolo layer and hence performs NMS in each region layer.

Is the nms spurious?

The NMS was added in the YOLOv2 PR where there was just one region layer. The next step after the region computation would be NMS (which is probably why NMS was integrated into region). YOLOv3 has three region layers. Is it right to use the region layer as it is without disabling NMS?

Performance penalty for the CUDA backend:

The NMS is performed on CPU in the CUDA backend. This has a huge performance toll. The switch from GPU to CPU during inference introduces additional synchronization overhead, interference from OS scheduling decisions and prevents the latency hiding ability of CUDA streams.

The toll is so significant that FPS of YOLOv4 improves by almost 40% on RTX 2070 Super when NMS is disabled.

Issue submission checklist

I report the issue, it's not a question

I checked the problem with documentation, FAQ, open issues,

answers.opencv.org, Stack Overflow, etc and have not found solution

I updated to latest OpenCV version and the issue is still there

There is reproducer code and related data files: videos, images, onnx, etc