diff --git a/build/.qmake.stash b/build/.qmake.stash new file mode 100644 index 0000000..1e8c48c --- /dev/null +++ b/build/.qmake.stash @@ -0,0 +1,23 @@ +QMAKE_CXX.QT_COMPILER_STDCXX = 201703L +QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 11 +QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 4 +QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0 +QMAKE_CXX.COMPILER_MACROS = \ + QT_COMPILER_STDCXX \ + QMAKE_GCC_MAJOR_VERSION \ + QMAKE_GCC_MINOR_VERSION \ + QMAKE_GCC_PATCH_VERSION +QMAKE_CXX.INCDIRS = \ + /usr/include/c++/11 \ + /usr/include/aarch64-linux-gnu/c++/11 \ + /usr/include/c++/11/backward \ + /usr/lib/gcc/aarch64-linux-gnu/11/include \ + /usr/local/include \ + /usr/include/aarch64-linux-gnu \ + /usr/include +QMAKE_CXX.LIBDIRS = \ + /usr/lib/gcc/aarch64-linux-gnu/11 \ + /usr/lib/aarch64-linux-gnu \ + /usr/lib \ + /lib/aarch64-linux-gnu \ + /lib diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..042db73 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,492 @@ +############################################################################# +# Makefile for building: fast-yolopv2 +# Generated by qmake (3.1) (Qt 5.15.3) +# Project: ../fast-yolopv2.pro +# Template: app +# Command: /usr/lib/qt5/bin/qmake -o Makefile ../fast-yolopv2.pro -spec linux-g++ +############################################################################# + +MAKEFILE = Makefile + +EQ = = + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DOPENCV -DGPU -DCUDNN -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC $(DEFINES) +CXXFLAGS = -pipe -O2 -std=gnu++11 -Wall -Wextra -D_REENTRANT -fPIC $(DEFINES) +INCPATH = -I../../Fast-YolopV2 -I. -I/usr/local/Opencv-4.10.0/include/opencv4 -I/usr/local/cuda-12.6/include -I/usr/local/include/onnxruntime -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtWidgets -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I. -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ +QMAKE = /usr/lib/qt5/bin/qmake +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +COPY = cp -f +COPY_FILE = cp -f +COPY_DIR = cp -f -R +INSTALL_FILE = install -m 644 -p +INSTALL_PROGRAM = install -m 755 -p +INSTALL_DIR = cp -f -R +QINSTALL = /usr/lib/qt5/bin/qmake -install qinstall +QINSTALL_PROGRAM = /usr/lib/qt5/bin/qmake -install qinstall -exe +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +TAR = tar -cf +COMPRESS = gzip -9f +DISTNAME = fast-yolopv21.0.0 +DISTDIR = /home/wuxianfu/Projects/Fast-YolopV2/build/.tmp/fast-yolopv21.0.0 +LINK = g++ +LFLAGS = -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/local/Opencv-4.10.0/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs -lopencv_videoio -L/usr/local/lib -lonnxruntime /usr/lib/aarch64-linux-gnu/libQt5Widgets.so /usr/lib/aarch64-linux-gnu/libQt5Gui.so /usr/lib/aarch64-linux-gnu/libQt5Core.so -lGL -lpthread +AR = ar cqs +RANLIB = +SED = sed +STRIP = strip + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = ../YOLOPv2.cpp \ + ../main.cpp \ + ../mainwindow.cpp moc_mainwindow.cpp +OBJECTS = YOLOPv2.o \ + main.o \ + mainwindow.o \ + moc_mainwindow.o +DIST = /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/sanitize.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_egl_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fb_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_glx_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_input_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_kms_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_service_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_theme_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + ../.qmake.stash \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/toolchain.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources_functions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qmake_use.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/file_copies.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/lex.prf \ + ../../fast-yolopv2.pro ../YOLOPv2.h \ + ../mainwindow.h ../YOLOPv2.cpp \ + ../main.cpp \ + ../mainwindow.cpp +QMAKE_TARGET = fast-yolopv2 +DESTDIR = +TARGET = fast-yolopv2 + + +first: all +####### Build rules + +fast-yolopv2: ui_mainwindow.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: ../fast-yolopv2.pro /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/linux.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/sanitize.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-base.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/qconfig.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_egl_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fb_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_glx_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_input_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_kms_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_service_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_theme_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_config.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_post.prf \ + .qmake.stash \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/toolchain.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_pre.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_post.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/warn_on.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources_functions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/moc.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/uic.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qmake_use.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/file_copies.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exceptions.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/yacc.prf \ + /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/lex.prf \ + ../fast-yolopv2.pro + $(QMAKE) -o Makefile ../fast-yolopv2.pro -spec linux-g++ +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_pre.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/unix.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/linux.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/sanitize.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-base.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/common/g++-unix.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/qconfig.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_accessibility_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_egl_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_kms_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfsdeviceintegration_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_eventdispatcher_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fb_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_fontdatabase_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_glx_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_input_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_kms_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_linuxaccessibility_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformcompositor_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_service_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_theme_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_functions.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt_config.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++/qmake.conf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/spec_post.prf: +.qmake.stash: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/toolchain.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_pre.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resolve_config.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/default_post.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/warn_on.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qt.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources_functions.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/resources.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/moc.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/uic.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/unix/thread.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/qmake_use.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/file_copies.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/exceptions.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/yacc.prf: +/usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/lex.prf: +../fast-yolopv2.pro: +qmake: FORCE + @$(QMAKE) -o Makefile ../fast-yolopv2.pro -spec linux-g++ + +qmake_all: FORCE + + +all: Makefile fast-yolopv2 + +dist: distdir FORCE + (cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR) + +distdir: FORCE + @test -d $(DISTDIR) || mkdir -p $(DISTDIR) + $(COPY_FILE) --parents $(DIST) $(DISTDIR)/ + $(COPY_FILE) --parents /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp $(DISTDIR)/ + $(COPY_FILE) --parents ../YOLOPv2.h ../mainwindow.h $(DISTDIR)/ + $(COPY_FILE) --parents ../YOLOPv2.cpp ../main.cpp ../mainwindow.cpp $(DISTDIR)/ + $(COPY_FILE) --parents ../mainwindow.ui $(DISTDIR)/ + + +clean: compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) .qmake.stash + -$(DEL_FILE) Makefile + + +####### Sub-libraries + +mocclean: compiler_moc_header_clean compiler_moc_objc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_objc_header_make_all compiler_moc_source_make_all + +check: first + +benchmark: first + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_predefs_make_all: moc_predefs.h +compiler_moc_predefs_clean: + -$(DEL_FILE) moc_predefs.h +moc_predefs.h: /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp + g++ -pipe -O2 -std=gnu++11 -Wall -Wextra -dM -E -o moc_predefs.h /usr/lib/aarch64-linux-gnu/qt5/mkspecs/features/data/dummy.cpp + +compiler_moc_header_make_all: moc_mainwindow.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_mainwindow.cpp +moc_mainwindow.cpp: ../mainwindow.h \ + moc_predefs.h \ + /usr/lib/qt5/bin/moc + /usr/lib/qt5/bin/moc $(DEFINES) --include /home/wuxianfu/Projects/Fast-YolopV2/build/moc_predefs.h -I/usr/lib/aarch64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/wuxianfu/Projects/Fast-YolopV2 -I/usr/local/Opencv-4.10.0/include/opencv4 -I/usr/local/cuda-12.6/include -I/usr/local/include/onnxruntime -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtWidgets -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I. -I/usr/include/c++/11 -I/usr/include/aarch64-linux-gnu/c++/11 -I/usr/include/c++/11/backward -I/usr/lib/gcc/aarch64-linux-gnu/11/include -I/usr/local/include -I/usr/include/aarch64-linux-gnu -I/usr/include ../mainwindow.h -o moc_mainwindow.cpp + +compiler_moc_objc_header_make_all: +compiler_moc_objc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_mainwindow.h +compiler_uic_clean: + -$(DEL_FILE) ui_mainwindow.h +ui_mainwindow.h: ../mainwindow.ui \ + /usr/lib/qt5/bin/uic + /usr/lib/qt5/bin/uic ../mainwindow.ui -o ui_mainwindow.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_predefs_clean compiler_moc_header_clean compiler_uic_clean + +####### Compile + +YOLOPv2.o: ../YOLOPv2.cpp ../YOLOPv2.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgproc.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvdef.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/version.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/hal/interface.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cv_cpu_dispatch.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cv_cpu_helper.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/hal/msa_macros.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/fast_math.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/base.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/opencv_modules.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd_wrapper.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/neon_utils.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/vsx_utils.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/check.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/traits.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/matx.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/saturate.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/matx.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/types.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/mat.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/bufferpool.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/mat.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/persistence.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/operations.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utility.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utils/instrumentation.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utils/tls.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/optim.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/ovx.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgproc/segmentation.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/highgui.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgcodecs.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/videoio.hpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o YOLOPv2.o ../YOLOPv2.cpp + +main.o: ../main.cpp ../mainwindow.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../main.cpp + +mainwindow.o: ../mainwindow.cpp ../mainwindow.h \ + ui_mainwindow.h \ + ../YOLOPv2.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgproc.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvdef.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/version.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/hal/interface.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cv_cpu_dispatch.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cv_cpu_helper.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/hal/msa_macros.h \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/fast_math.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/base.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/opencv_modules.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd_wrapper.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/neon_utils.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/vsx_utils.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/check.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/traits.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/matx.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/saturate.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/matx.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/types.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/mat.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/bufferpool.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/mat.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/persistence.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/operations.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/cvstd.inl.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utility.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utils/instrumentation.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/utils/tls.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/optim.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/core/ovx.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgproc/segmentation.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/highgui.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/imgcodecs.hpp \ + /usr/local/Opencv-4.10.0/include/opencv4/opencv2/videoio.hpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o ../mainwindow.cpp + +moc_mainwindow.o: moc_mainwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp + +####### Install + +install_target: first FORCE + @test -d $(INSTALL_ROOT)/opt/fast-yolopv2/bin || mkdir -p $(INSTALL_ROOT)/opt/fast-yolopv2/bin + $(QINSTALL_PROGRAM) $(QMAKE_TARGET) $(INSTALL_ROOT)/opt/fast-yolopv2/bin/$(QMAKE_TARGET) + -$(STRIP) $(INSTALL_ROOT)/opt/fast-yolopv2/bin/$(QMAKE_TARGET) + +uninstall_target: FORCE + -$(DEL_FILE) $(INSTALL_ROOT)/opt/fast-yolopv2/bin/$(QMAKE_TARGET) + -$(DEL_DIR) $(INSTALL_ROOT)/opt/fast-yolopv2/bin/ + + +install: install_target FORCE + +uninstall: uninstall_target FORCE + +FORCE: + diff --git a/build/YOLOPv2.o b/build/YOLOPv2.o new file mode 100644 index 0000000..08eafa8 Binary files /dev/null and b/build/YOLOPv2.o differ diff --git a/build/coco.names b/build/coco.names new file mode 100644 index 0000000..a1a11c4 --- /dev/null +++ b/build/coco.names @@ -0,0 +1,80 @@ +person +bicycle +car +motorcycle +airplane +bus +train +truck +boat +traffic light +fire hydrant +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +backpack +umbrella +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +couch +potted plant +bed +dining table +toilet +tv +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +book +clock +vase +scissors +teddy bear +hair drier +toothbrush diff --git a/build/fast b/build/fast new file mode 100755 index 0000000..75ac0b4 Binary files /dev/null and b/build/fast differ diff --git a/build/fast-yolopv2 b/build/fast-yolopv2 new file mode 100755 index 0000000..1cf9cf2 Binary files /dev/null and b/build/fast-yolopv2 differ diff --git a/build/fast.debug b/build/fast.debug new file mode 100644 index 0000000..056cafa Binary files /dev/null and b/build/fast.debug differ diff --git a/build/images/0ace96c3-48481887.jpg b/build/images/0ace96c3-48481887.jpg new file mode 100644 index 0000000..8981747 Binary files /dev/null and b/build/images/0ace96c3-48481887.jpg differ diff --git a/build/images/3c0e7240-96e390d2.jpg b/build/images/3c0e7240-96e390d2.jpg new file mode 100644 index 0000000..bf2b675 Binary files /dev/null and b/build/images/3c0e7240-96e390d2.jpg differ diff --git a/build/images/7dd9ef45-f197db95.jpg b/build/images/7dd9ef45-f197db95.jpg new file mode 100644 index 0000000..5de5771 Binary files /dev/null and b/build/images/7dd9ef45-f197db95.jpg differ diff --git a/build/images/8e1c1ab0-a8b92173.jpg b/build/images/8e1c1ab0-a8b92173.jpg new file mode 100644 index 0000000..b9d3825 Binary files /dev/null and b/build/images/8e1c1ab0-a8b92173.jpg differ diff --git a/build/images/9aa94005-ff1d4c9a.jpg b/build/images/9aa94005-ff1d4c9a.jpg new file mode 100644 index 0000000..e0e9278 Binary files /dev/null and b/build/images/9aa94005-ff1d4c9a.jpg differ diff --git a/build/images/adb4871d-4d063244.jpg b/build/images/adb4871d-4d063244.jpg new file mode 100644 index 0000000..1564575 Binary files /dev/null and b/build/images/adb4871d-4d063244.jpg differ diff --git a/build/main.o b/build/main.o new file mode 100644 index 0000000..78d4dae Binary files /dev/null and b/build/main.o differ diff --git a/build/mainwindow.o b/build/mainwindow.o new file mode 100644 index 0000000..e40a69d Binary files /dev/null and b/build/mainwindow.o differ diff --git a/build/moc_mainwindow.cpp b/build/moc_mainwindow.cpp new file mode 100644 index 0000000..8c21a78 --- /dev/null +++ b/build/moc_mainwindow.cpp @@ -0,0 +1,95 @@ +/**************************************************************************** +** Meta object code from reading C++ file 'mainwindow.h' +** +** Created by: The Qt Meta Object Compiler version 67 (Qt 5.15.3) +** +** WARNING! All changes made in this file will be lost! +*****************************************************************************/ + +#include +#include "../mainwindow.h" +#include +#include +#if !defined(Q_MOC_OUTPUT_REVISION) +#error "The header file 'mainwindow.h' doesn't include ." +#elif Q_MOC_OUTPUT_REVISION != 67 +#error "This file was generated using the moc from 5.15.3. It" +#error "cannot be used with the include files from this version of Qt." +#error "(The moc has changed too much.)" +#endif + +QT_BEGIN_MOC_NAMESPACE +QT_WARNING_PUSH +QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_MainWindow_t { + QByteArrayData data[1]; + char stringdata0[11]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = { + { +QT_MOC_LITERAL(0, 0, 10) // "MainWindow" + + }, + "MainWindow" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_MainWindow[] = { + + // content: + 8, // revision + 0, // classname + 0, 0, // classinfo + 0, 0, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + 0 // eod +}; + +void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + (void)_o; + (void)_id; + (void)_c; + (void)_a; +} + +QT_INIT_METAOBJECT const QMetaObject MainWindow::staticMetaObject = { { + QMetaObject::SuperData::link(), + qt_meta_stringdata_MainWindow.data, + qt_meta_data_MainWindow, + qt_static_metacall, + nullptr, + nullptr +} }; + + +const QMetaObject *MainWindow::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *MainWindow::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0)) + return static_cast(this); + return QMainWindow::qt_metacast(_clname); +} + +int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QMainWindow::qt_metacall(_c, _id, _a); + return _id; +} +QT_WARNING_POP +QT_END_MOC_NAMESPACE diff --git a/build/moc_mainwindow.o b/build/moc_mainwindow.o new file mode 100644 index 0000000..de31cb9 Binary files /dev/null and b/build/moc_mainwindow.o differ diff --git a/build/moc_predefs.h b/build/moc_predefs.h new file mode 100644 index 0000000..1a264f6 --- /dev/null +++ b/build/moc_predefs.h @@ -0,0 +1,407 @@ +#define __SSP_STRONG__ 3 +#define __DBL_MIN_EXP__ (-1021) +#define __LDBL_MANT_DIG__ 113 +#define __cpp_attributes 200809L +#define __UINT_LEAST16_MAX__ 0xffff +#define __ARM_SIZEOF_WCHAR_T 4 +#define __DBL_DECIMAL_DIG__ 17 +#define __ATOMIC_ACQUIRE 2 +#define __FLT128_MAX_10_EXP__ 4932 +#define __FLT_MIN__ 1.17549435082228750796873653722224568e-38F +#define __GCC_IEC_559_COMPLEX 2 +#define __UINT_LEAST8_TYPE__ unsigned char +#define __FLT128_DIG__ 33 +#define __INTMAX_C(c) c ## L +#define __CHAR_BIT__ 8 +#define __UINT8_MAX__ 0xff +#define __cpp_static_assert 200410L +#define __WCHAR_MAX__ 0xffffffffU +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +#define __GCC_IEC_559 2 +#define __FLT32X_DECIMAL_DIG__ 17 +#define __FLT_EVAL_METHOD__ 0 +#define __cpp_binary_literals 201304L +#define __FLT64_DECIMAL_DIG__ 17 +#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +#define __cpp_variadic_templates 200704L +#define __UINT_FAST32_TYPE__ long unsigned int +#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL +#define __SIG_ATOMIC_TYPE__ int +#define __DBL_MIN_10_EXP__ (-307) +#define __FINITE_MATH_ONLY__ 0 +#define __FLT32X_MAX_EXP__ 1024 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +#define __GNUC_PATCHLEVEL__ 0 +#define __FLT32_HAS_DENORM__ 1 +#define __UINT_FAST8_MAX__ 0xff +#define __cpp_rvalue_reference 200610L +#define __INT8_C(c) c +#define __INT_LEAST8_WIDTH__ 8 +#define __INTMAX_TYPE__ long int +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL +#define __INT_LEAST8_MAX__ 0x7f +#define __SHRT_MAX__ 0x7fff +#define __STDC_ISO_10646__ 201706L +#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L +#define __ARM_FEATURE_IDIV 1 +#define __FLT64X_MAX_10_EXP__ 4932 +#define __LDBL_IS_IEC_60559__ 2 +#define __ARM_FP 14 +#define __FLT64X_IS_IEC_60559__ 2 +#define __FLT64X_HAS_QUIET_NAN__ 1 +#define __WINT_TYPE__ unsigned int +#define __UINT_LEAST8_MAX__ 0xff +#define __FLT128_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F128 +#define __UINTMAX_TYPE__ long unsigned int +#define _STDC_PREDEF_H 1 +#define __cpp_nsdmi 200809L +#define __linux 1 +#define __OPTIMIZE__ 1 +#define __CHAR_UNSIGNED__ 1 +#define __UINT32_MAX__ 0xffffffffU +#define __DBL_DENORM_MIN__ double(4.94065645841246544176568792868221372e-324L) +#define __AARCH64_CMODEL_SMALL__ 1 +#define __LDBL_MAX_EXP__ 16384 +#define __INT_FAST32_WIDTH__ 64 +#define __FLT128_MIN_EXP__ (-16381) +#define __FLT128_MIN_10_EXP__ (-4931) +#define __FLT32X_IS_IEC_60559__ 2 +#define __INT_LEAST16_WIDTH__ 16 +#define __SCHAR_MAX__ 0x7f +#define __FLT128_MANT_DIG__ 113 +#define __DBL_MAX__ double(1.79769313486231570814527423731704357e+308L) +#define __FLT32X_DIG__ 15 +#define __WCHAR_MIN__ 0U +#define __INT64_C(c) c ## L +#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +#define _FORTIFY_SOURCE 2 +#define __SIZEOF_INT__ 4 +#define __INT_FAST64_WIDTH__ 64 +#define __PRAGMA_REDEFINE_EXTNAME 1 +#define __FLT32X_MANT_DIG__ 53 +#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +#define __USER_LABEL_PREFIX__ +#define __FLT32_MAX_10_EXP__ 38 +#define __FLT64X_EPSILON__ 1.92592994438723585305597794258492732e-34F64x +#define __STDC_HOSTED__ 1 +#define __DBL_DIG__ 15 +#define __FLT32_DIG__ 6 +#define __FLT_EPSILON__ 1.19209289550781250000000000000000000e-7F +#define __GXX_WEAK__ 1 +#define __SHRT_WIDTH__ 16 +#define __FLT32_IS_IEC_60559__ 2 +#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L +#define __FLT16_HAS_QUIET_NAN__ 1 +#define __cpp_threadsafe_static_init 200806L +#define __ARM_SIZEOF_MINIMAL_ENUM 4 +#define __FLT64X_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966F64x +#define __FP_FAST_FMA 1 +#define __FLT32X_HAS_INFINITY__ 1 +#define __INT32_MAX__ 0x7fffffff +#define __FLT16_DIG__ 3 +#define __INT_WIDTH__ 32 +#define __SIZEOF_LONG__ 8 +#define __STDC_IEC_559__ 1 +#define __UINT16_C(c) c +#define __DECIMAL_DIG__ 36 +#define __STDC_IEC_559_COMPLEX__ 1 +#define __FLT64_EPSILON__ 2.22044604925031308084726333618164062e-16F64 +#define __gnu_linux__ 1 +#define __INT16_MAX__ 0x7fff +#define __FLT64_MIN_EXP__ (-1021) +#define __FLT64X_MIN_10_EXP__ (-4931) +#define __LDBL_HAS_QUIET_NAN__ 1 +#define __FLT16_MIN_EXP__ (-13) +#define __FLT64_MANT_DIG__ 53 +#define __FLT64X_MANT_DIG__ 113 +#define __GNUC__ 11 +#define __pie__ 2 +#define __GXX_RTTI 1 +#define __FLT_HAS_DENORM__ 1 +#define __SIZEOF_LONG_DOUBLE__ 16 +#define __cpp_rtti 199711L +#define __LDBL_MIN_EXP__ (-16381) +#define __STDC_UTF_16__ 1 +#define __FLT64_MAX_10_EXP__ 308 +#define __FLT16_MAX_10_EXP__ 4 +#define __DBL_IS_IEC_60559__ 2 +#define __FLT32_HAS_INFINITY__ 1 +#define __cpp_raw_strings 200710L +#define __INT_FAST32_MAX__ 0x7fffffffffffffffL +#define __DBL_HAS_INFINITY__ 1 +#define __HAVE_SPECULATION_SAFE_VALUE 1 +#define __INTPTR_WIDTH__ 64 +#define __cpp_delegating_constructors 200604L +#define __FLT32X_HAS_DENORM__ 1 +#define __INT_FAST16_TYPE__ long int +#define __LDBL_HAS_DENORM__ 1 +#define __cplusplus 201103L +#define __cpp_ref_qualifiers 200710L +#define __FLT32_DECIMAL_DIG__ 9 +#define __DEPRECATED 1 +#define __cpp_rvalue_references 200610L +#define __DBL_MAX_EXP__ 1024 +#define __WCHAR_WIDTH__ 32 +#define __FLT64_MAX__ 1.79769313486231570814527423731704357e+308F64 +#define __FLT32_MAX__ 3.40282346638528859811704183484516925e+38F32 +#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +#define __FLT16_DECIMAL_DIG__ 5 +#define __FLT_IS_IEC_60559__ 2 +#define __FLT32_HAS_QUIET_NAN__ 1 +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#define __SIZEOF_SIZE_T__ 8 +#define __SIG_ATOMIC_WIDTH__ 32 +#define __ARM_ALIGN_MAX_PWR 28 +#define __SIZEOF_WINT_T__ 4 +#define __LONG_LONG_WIDTH__ 64 +#define __cpp_initializer_lists 200806L +#define __FLT32_MAX_EXP__ 128 +#define __cpp_hex_float 201603L +#define __ARM_FP16_FORMAT_IEEE 1 +#define __FLT128_HAS_INFINITY__ 1 +#define __FLT_MIN_EXP__ (-125) +#define __FLT64_NORM_MAX__ 1.79769313486231570814527423731704357e+308F64 +#define __PIE__ 2 +#define __GCC_HAVE_DWARF2_CFI_ASM 1 +#define __cpp_lambdas 200907L +#define __FLT32X_MIN_EXP__ (-1021) +#define __INT_FAST64_TYPE__ long int +#define __ARM_FP16_ARGS 1 +#define __FP_FAST_FMAF 1 +#define __FLT128_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F128 +#define __FLT64_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F64 +#define __DBL_MIN__ double(2.22507385850720138309023271733240406e-308L) +#define __ARM_FEATURE_CLZ 1 +#define __FLT16_DENORM_MIN__ 5.96046447753906250000000000000000000e-8F16 +#define __unix__ 1 +#define __FLT64X_NORM_MAX__ 1.18973149535723176508575932662800702e+4932F64x +#define __SIZEOF_POINTER__ 8 +#define __LP64__ 1 +#define __DBL_HAS_QUIET_NAN__ 1 +#define __FLT_EVAL_METHOD_C99__ 0 +#define __FLT32X_EPSILON__ 2.22044604925031308084726333618164062e-16F32x +#define __UINT64_MAX__ 0xffffffffffffffffUL +#define __LDBL_DECIMAL_DIG__ 36 +#define __FLT_MAX__ 3.40282346638528859811704183484516925e+38F +#define __aarch64__ 1 +#define __FLT64_MIN_10_EXP__ (-307) +#define __FLT64X_DECIMAL_DIG__ 36 +#define __REGISTER_PREFIX__ +#define __UINT16_MAX__ 0xffff +#define __INTMAX_WIDTH__ 64 +#define __LDBL_HAS_INFINITY__ 1 +#define __FLT_DIG__ 6 +#define __DEC_EVAL_METHOD__ 2 +#define __FLT_MANT_DIG__ 24 +#define __FLT16_MIN_10_EXP__ (-4) +#define __VERSION__ "11.4.0" +#define __UINT64_C(c) c ## UL +#define __cpp_unicode_characters 200704L +#define __FLT128_IS_IEC_60559__ 2 +#define __GXX_ABI_VERSION 1016 +#define __WINT_MAX__ 0xffffffffU +#define __INT_LEAST32_MAX__ 0x7fffffff +#define __GCC_ATOMIC_INT_LOCK_FREE 2 +#define __FLT32X_MIN__ 2.22507385850720138309023271733240406e-308F32x +#define __FLT128_MAX_EXP__ 16384 +#define __FLT32_MANT_DIG__ 24 +#define __AARCH64EL__ 1 +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __FLT16_MAX_EXP__ 16 +#define __BIGGEST_ALIGNMENT__ 16 +#define __STDC_IEC_60559_COMPLEX__ 201404L +#define __INT32_C(c) c +#define __FLT128_HAS_DENORM__ 1 +#define __SCHAR_WIDTH__ 8 +#define __ORDER_PDP_ENDIAN__ 3412 +#define __ARM_64BIT_STATE 1 +#define __INT_FAST32_TYPE__ long int +#define __UINT_LEAST16_TYPE__ short unsigned int +#define __SIZE_TYPE__ long unsigned int +#define __GNUC_WIDE_EXECUTION_CHARSET_NAME "UTF-32LE" +#define __FLT64X_DIG__ 33 +#define __ARM_FEATURE_FMA 1 +#define __INT8_TYPE__ signed char +#define __GNUG__ 11 +#define __ELF__ 1 +#define __GCC_ASM_FLAG_OUTPUTS__ 1 +#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +#define __FLT_RADIX__ 2 +#define __INT_LEAST16_TYPE__ short int +#define __ARM_ARCH_PROFILE 65 +#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L +#define __UINTMAX_C(c) c ## UL +#define __GLIBCXX_BITSIZE_INT_N_0 128 +#define __ARM_PCS_AAPCS64 1 +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#define __INT_LEAST64_WIDTH__ 64 +#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +#define __STDC_IEC_60559_BFP__ 201404L +#define __SIZEOF_PTRDIFF_T__ 8 +#define __ATOMIC_RELAXED 0 +#define __FLT_EVAL_METHOD_TS_18661_3__ 0 +#define __LDBL_DIG__ 33 +#define __FLT64_IS_IEC_60559__ 2 +#define __FLT16_IS_IEC_60559__ 2 +#define __INT_FAST16_MAX__ 0x7fffffffffffffffL +#define __FLT64_DIG__ 15 +#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL +#define __UINT_LEAST64_TYPE__ long unsigned int +#define __FLT16_EPSILON__ 9.76562500000000000000000000000000000e-4F16 +#define __FLT_HAS_QUIET_NAN__ 1 +#define __FLT_MAX_10_EXP__ 38 +#define __LONG_MAX__ 0x7fffffffffffffffL +#define __FLT64X_HAS_DENORM__ 1 +#define __FLT_HAS_INFINITY__ 1 +#define __GNUC_EXECUTION_CHARSET_NAME "UTF-8" +#define __unix 1 +#define __cpp_unicode_literals 200710L +#define __DBL_HAS_DENORM__ 1 +#define __UINT_FAST16_TYPE__ long unsigned int +#define __FLT32X_HAS_QUIET_NAN__ 1 +#define __CHAR16_TYPE__ short unsigned int +#define __FLT64X_MAX_EXP__ 16384 +#define __SIZE_WIDTH__ 64 +#define __INT_LEAST16_MAX__ 0x7fff +#define __FLT16_NORM_MAX__ 6.55040000000000000000000000000000000e+4F16 +#define __INT64_MAX__ 0x7fffffffffffffffL +#define __FLT32_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F32 +#define __INT_LEAST64_TYPE__ long int +#define __INT16_TYPE__ short int +#define __INT_LEAST8_TYPE__ signed char +#define __FLT16_MAX__ 6.55040000000000000000000000000000000e+4F16 +#define __INT_FAST8_MAX__ 0x7f +#define __ARM_ARCH 8 +#define __FLT128_MAX__ 1.18973149535723176508575932662800702e+4932F128 +#define __INTPTR_MAX__ 0x7fffffffffffffffL +#define linux 1 +#define __ARM_FEATURE_UNALIGNED 1 +#define __FLT64_HAS_QUIET_NAN__ 1 +#define __GXX_EXPERIMENTAL_CXX0X__ 1 +#define __FLT64X_MIN_EXP__ (-16381) +#define __FLT32_MIN_10_EXP__ (-37) +#define __UINT8_TYPE__ unsigned char +#define __PTRDIFF_WIDTH__ 64 +#define __FLT64_HAS_INFINITY__ 1 +#define __FLT64X_MAX__ 1.18973149535723176508575932662800702e+4932F64x +#define __FLT16_HAS_INFINITY__ 1 +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +#define __PTRDIFF_MAX__ 0x7fffffffffffffffL +#define __FLT16_MANT_DIG__ 11 +#define __INTPTR_TYPE__ long int +#define __UINT16_TYPE__ short unsigned int +#define __WCHAR_TYPE__ unsigned int +#define __cpp_range_based_for 200907L +#define __pic__ 2 +#define __UINTPTR_MAX__ 0xffffffffffffffffUL +#define __ARM_ARCH_8A 1 +#define __cpp_decltype 200707L +#define __INT_FAST64_MAX__ 0x7fffffffffffffffL +#define __FLT_NORM_MAX__ 3.40282346638528859811704183484516925e+38F +#define __UINT_FAST64_TYPE__ long unsigned int +#define __INT_MAX__ 0x7fffffff +#define __STDCPP_THREADS__ 1 +#define __INT64_TYPE__ long int +#define __FLT_MAX_EXP__ 128 +#define __ORDER_BIG_ENDIAN__ 4321 +#define __DBL_MANT_DIG__ 53 +#define __cpp_inheriting_constructors 201511L +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL +#define __FP_FAST_FMAF32 1 +#define __UINT_LEAST32_TYPE__ unsigned int +#define __SIZEOF_SHORT__ 2 +#define __FLT32_NORM_MAX__ 3.40282346638528859811704183484516925e+38F32 +#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +#define __WINT_WIDTH__ 32 +#define __FP_FAST_FMAF64 1 +#define __FLT32X_MAX_10_EXP__ 308 +#define __SIZEOF_INT128__ 16 +#define __FLT16_MIN__ 6.10351562500000000000000000000000000e-5F16 +#define __WCHAR_UNSIGNED__ 1 +#define __LDBL_MAX_10_EXP__ 4932 +#define __DBL_EPSILON__ double(2.22044604925031308084726333618164062e-16L) +#define __FLT32_MIN_EXP__ (-125) +#define __FLT128_MIN__ 3.36210314311209350626267781732175260e-4932F128 +#define _LP64 1 +#define __UINT8_C(c) c +#define __FLT64_MAX_EXP__ 1024 +#define __INT_LEAST32_TYPE__ int +#define __ARM_NEON 1 +#define __FLT128_HAS_QUIET_NAN__ 1 +#define __INTMAX_MAX__ 0x7fffffffffffffffL +#define __UINT_FAST8_TYPE__ unsigned char +#define __INT_FAST8_TYPE__ signed char +#define __FLT64X_MIN__ 3.36210314311209350626267781732175260e-4932F64x +#define __GNUC_STDC_INLINE__ 1 +#define __FLT64_HAS_DENORM__ 1 +#define __FLT32_EPSILON__ 1.19209289550781250000000000000000000e-7F32 +#define __FP_FAST_FMAF32x 1 +#define __FLT16_HAS_DENORM__ 1 +#define __STDC_UTF_32__ 1 +#define __INT_FAST8_WIDTH__ 8 +#define __FLT32X_MAX__ 1.79769313486231570814527423731704357e+308F32x +#define __cpp_alias_templates 200704L +#define __DBL_NORM_MAX__ double(1.79769313486231570814527423731704357e+308L) +#define __FLT64X_HAS_INFINITY__ 1 +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#define __ARM_ALIGN_MAX_STACK_PWR 16 +#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L +#define __SIZEOF_WCHAR_T__ 4 +#define unix 1 +#define __cpp_runtime_arrays 198712L +#define __UINT64_TYPE__ long unsigned int +#define __UINT32_C(c) c ## U +#define __WINT_MIN__ 0U +#define __INT8_MAX__ 0x7f +#define __LONG_WIDTH__ 64 +#define __PIC__ 2 +#define __FLT32X_NORM_MAX__ 1.79769313486231570814527423731704357e+308F32x +#define __CHAR32_TYPE__ unsigned int +#define __cpp_constexpr 200704L +#define __ARM_FEATURE_NUMERIC_MAXMIN 1 +#define __INT32_TYPE__ int +#define __SIZEOF_DOUBLE__ 8 +#define __cpp_exceptions 199711L +#define __FLT64_MIN__ 2.22507385850720138309023271733240406e-308F64 +#define __FLT_DENORM_MIN__ 1.40129846432481707092372958328991613e-45F +#define __INT_LEAST32_WIDTH__ 32 +#define __SIZEOF_FLOAT__ 4 +#define __ATOMIC_CONSUME 1 +#define __GNUC_MINOR__ 4 +#define __GLIBCXX_TYPE_INT_N_0 __int128 +#define __INT_FAST16_WIDTH__ 64 +#define __UINTMAX_MAX__ 0xffffffffffffffffUL +#define __FLT32X_DENORM_MIN__ 4.94065645841246544176568792868221372e-324F32x +#define __DBL_MAX_10_EXP__ 308 +#define __INT16_C(c) c +#define __ARM_ARCH_ISA_A64 1 +#define __STDC__ 1 +#define __PTRDIFF_TYPE__ long int +#define __FLT32_MIN__ 1.17549435082228750796873653722224568e-38F32 +#define __ATOMIC_SEQ_CST 5 +#define __EXCEPTIONS 1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1 +#define __UINT32_TYPE__ unsigned int +#define __FLT32X_MIN_10_EXP__ (-307) +#define __UINTPTR_TYPE__ long unsigned int +#define __linux__ 1 +#define __LDBL_MIN_10_EXP__ (-4931) +#define __FLT128_EPSILON__ 1.92592994438723585305597794258492732e-34F128 +#define __SIZEOF_LONG_LONG__ 8 +#define __cpp_user_defined_literals 200809L +#define __FLT128_DECIMAL_DIG__ 36 +#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +#define __FLT_DECIMAL_DIG__ 9 +#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL +#define __LDBL_NORM_MAX__ 1.18973149535723176508575932662800702e+4932L +#define __FLT_MIN_10_EXP__ (-37) +#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +#define __ORDER_LITTLE_ENDIAN__ 1234 +#define __SIZE_MAX__ 0xffffffffffffffffUL +#define _GNU_SOURCE 1 +#define __UINT_LEAST32_MAX__ 0xffffffffU +#define __ATOMIC_ACQ_REL 4 +#define __ATOMIC_RELEASE 3 diff --git a/build/model/coco.names b/build/model/coco.names new file mode 100644 index 0000000..ca76c80 --- /dev/null +++ b/build/model/coco.names @@ -0,0 +1,80 @@ +person +bicycle +car +motorbike +aeroplane +bus +train +truck +boat +traffic light +fire hydrant +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +backpack +umbrella +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +sofa +pottedplant +bed +diningtable +toilet +tvmonitor +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +book +clock +vase +scissors +teddy bear +hair drier +toothbrush diff --git a/build/model/yolov4-tiny.cfg b/build/model/yolov4-tiny.cfg new file mode 100644 index 0000000..d990b51 --- /dev/null +++ b/build/model/yolov4-tiny.cfg @@ -0,0 +1,294 @@ +[net] +# Testing +#batch=1 +#subdivisions=1 +# Training +batch=64 +subdivisions=1 +width=416 +height=416 +channels=3 +momentum=0.9 +decay=0.0005 +angle=0 +saturation = 1.5 +exposure = 1.5 +hue=.1 + +learning_rate=0.00261 +burn_in=1000 + +max_batches = 2000200 +policy=steps +steps=1600000,1800000 +scales=.1,.1 + + +#weights_reject_freq=1001 +#ema_alpha=0.9998 +#equidistant_point=1000 +#num_sigmas_reject_badlabels=3 +#badlabels_rejection_percentage=0.2 + + +[convolutional] +batch_normalize=1 +filters=32 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers=-1 +groups=2 +group_id=1 + +[convolutional] +batch_normalize=1 +filters=32 +size=3 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=32 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -1,-2 + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -6,-1 + +[maxpool] +size=2 +stride=2 + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers=-1 +groups=2 +group_id=1 + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -1,-2 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -6,-1 + +[maxpool] +size=2 +stride=2 + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers=-1 +groups=2 +group_id=1 + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -1,-2 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -6,-1 + +[maxpool] +size=2 +stride=2 + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +################################## + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=255 +activation=linear + + + +[yolo] +mask = 3,4,5 +anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 +classes=80 +num=6 +jitter=.3 +scale_x_y = 1.05 +cls_normalizer=1.0 +iou_normalizer=0.07 +iou_loss=ciou +ignore_thresh = .7 +truth_thresh = 1 +random=0 +resize=1.5 +nms_kind=greedynms +beta_nms=0.6 +#new_coords=1 +#scale_x_y = 2.0 + +[route] +layers = -4 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[upsample] +stride=2 + +[route] +layers = -1, 23 + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=255 +activation=linear + +[yolo] +mask = 1,2,3 +anchors = 10,14, 23,27, 37,58, 81,82, 135,169, 344,319 +classes=80 +num=6 +jitter=.3 +scale_x_y = 1.05 +cls_normalizer=1.0 +iou_normalizer=0.07 +iou_loss=ciou +ignore_thresh = .7 +truth_thresh = 1 +random=0 +resize=1.5 +nms_kind=greedynms +beta_nms=0.6 +#new_coords=1 +#scale_x_y = 2.0 diff --git a/build/model/yolov4-tiny.weights b/build/model/yolov4-tiny.weights new file mode 100644 index 0000000..27edc5d Binary files /dev/null and b/build/model/yolov4-tiny.weights differ diff --git a/build/model/yolov4.cfg b/build/model/yolov4.cfg new file mode 100644 index 0000000..a7be12b --- /dev/null +++ b/build/model/yolov4.cfg @@ -0,0 +1,1158 @@ +[net] +batch=64 +subdivisions=8 +# Training +#width=512 +#height=512 +width=608 +height=608 +channels=3 +momentum=0.949 +decay=0.0005 +angle=0 +saturation = 1.5 +exposure = 1.5 +hue=.1 + +learning_rate=0.0013 +burn_in=1000 +max_batches = 500500 +policy=steps +steps=400000,450000 +scales=.1,.1 + +#cutmix=1 +mosaic=1 + +#:104x104 54:52x52 85:26x26 104:13x13 for 416 + +[convolutional] +batch_normalize=1 +filters=32 +size=3 +stride=1 +pad=1 +activation=mish + +# Downsample + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=2 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -2 + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=32 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -1,-7 + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +# Downsample + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=2 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -2 + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -1,-10 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +# Downsample + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=2 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -2 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -1,-28 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +# Downsample + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=2 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -2 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -1,-28 + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +# Downsample + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=2 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -2 + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=mish + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=mish + +[route] +layers = -1,-16 + +[convolutional] +batch_normalize=1 +filters=1024 +size=1 +stride=1 +pad=1 +activation=mish + +########################## + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +### SPP ### +[maxpool] +stride=1 +size=5 + +[route] +layers=-2 + +[maxpool] +stride=1 +size=9 + +[route] +layers=-4 + +[maxpool] +stride=1 +size=13 + +[route] +layers=-1,-3,-5,-6 +### End SPP ### + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[upsample] +stride=2 + +[route] +layers = 85 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -1, -3 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[upsample] +stride=2 + +[route] +layers = 54 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[route] +layers = -1, -3 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +########################## + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=255 +activation=linear + + +[yolo] +mask = 0,1,2 +anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401 +classes=80 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +scale_x_y = 1.2 +iou_thresh=0.213 +cls_normalizer=1.0 +iou_normalizer=0.07 +iou_loss=ciou +nms_kind=greedynms +beta_nms=0.6 +max_delta=5 + + +[route] +layers = -4 + +[convolutional] +batch_normalize=1 +size=3 +stride=2 +pad=1 +filters=256 +activation=leaky + +[route] +layers = -1, -16 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=255 +activation=linear + + +[yolo] +mask = 3,4,5 +anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401 +classes=80 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +scale_x_y = 1.1 +iou_thresh=0.213 +cls_normalizer=1.0 +iou_normalizer=0.07 +iou_loss=ciou +nms_kind=greedynms +beta_nms=0.6 +max_delta=5 + + +[route] +layers = -4 + +[convolutional] +batch_normalize=1 +size=3 +stride=2 +pad=1 +filters=512 +activation=leaky + +[route] +layers = -1, -37 + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=255 +activation=linear + + +[yolo] +mask = 6,7,8 +anchors = 12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401 +classes=80 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +random=1 +scale_x_y = 1.05 +iou_thresh=0.213 +cls_normalizer=1.0 +iou_normalizer=0.07 +iou_loss=ciou +nms_kind=greedynms +beta_nms=0.6 +max_delta=5 + diff --git a/build/model/yolov4.weights b/build/model/yolov4.weights new file mode 100755 index 0000000..921f440 Binary files /dev/null and b/build/model/yolov4.weights differ diff --git a/build/onnx/yolopv2_736x1280.onnx b/build/onnx/yolopv2_736x1280.onnx new file mode 100755 index 0000000..ea31bf7 Binary files /dev/null and b/build/onnx/yolopv2_736x1280.onnx differ diff --git a/build/videos/566a351c29c00924a337e91e85fa7dec.mp4 b/build/videos/566a351c29c00924a337e91e85fa7dec.mp4 new file mode 100644 index 0000000..9b64b71 Binary files /dev/null and b/build/videos/566a351c29c00924a337e91e85fa7dec.mp4 differ diff --git a/build/videos/test.mp4 b/build/videos/test.mp4 new file mode 100644 index 0000000..2c5b213 Binary files /dev/null and b/build/videos/test.mp4 differ diff --git a/build/videos/test1.mp4 b/build/videos/test1.mp4 new file mode 100755 index 0000000..037f9f2 Binary files /dev/null and b/build/videos/test1.mp4 differ diff --git a/build/yolop.onnx b/build/yolop.onnx new file mode 100644 index 0000000..67ebc04 Binary files /dev/null and b/build/yolop.onnx differ diff --git a/coco.names b/coco.names new file mode 100644 index 0000000..a1a11c4 --- /dev/null +++ b/coco.names @@ -0,0 +1,80 @@ +person +bicycle +car +motorcycle +airplane +bus +train +truck +boat +traffic light +fire hydrant +stop sign +parking meter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe +backpack +umbrella +handbag +tie +suitcase +frisbee +skis +snowboard +sports ball +kite +baseball bat +baseball glove +skateboard +surfboard +tennis racket +bottle +wine glass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hot dog +pizza +donut +cake +chair +couch +potted plant +bed +dining table +toilet +tv +laptop +mouse +remote +keyboard +cell phone +microwave +oven +toaster +sink +refrigerator +book +clock +vase +scissors +teddy bear +hair drier +toothbrush diff --git a/fast-yolopv2.pro.user b/fast-yolopv2.pro.user new file mode 100644 index 0000000..79fbf05 --- /dev/null +++ b/fast-yolopv2.pro.user @@ -0,0 +1,263 @@ + + + + + + EnvironmentId + {8e9210e5-1335-4be9-ab23-264e97928d47} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 2 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + 未命名 + 未命名 + {17edb790-9733-4e4c-9173-37d0ab7cfd4d} + 1 + 0 + 0 + + 0 + /home/wuxianfu/Projects/Fast-YolopV2/build + /home/wuxianfu/Projects/Fast-YolopV2/build + + + true + QtProjectManager.QMakeBuildStep + true + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/wuxianfu/Projects/Fast-YolopV2/build + /home/wuxianfu/Projects/Fast-YolopV2/build + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + + + 0 + /home/wuxianfu/Projects/Fast/build + /home/wuxianfu/Projects/Fast/build + + + true + QtProjectManager.QMakeBuildStep + true + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/home/wuxianfu/Projects/Fast-YolopV2/fast-yolopv2.pro + /home/wuxianfu/Projects/Fast-YolopV2/fast-yolopv2.pro + false + true + true + false + true + /home/wuxianfu/Projects/Fast-YolopV2/build + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/include/yolov4/darknet.h b/include/yolov4/darknet.h new file mode 100644 index 0000000..55ab50d --- /dev/null +++ b/include/yolov4/darknet.h @@ -0,0 +1,1125 @@ +#ifndef DARKNET_API +#define DARKNET_API + +#if defined(_MSC_VER) && _MSC_VER < 1900 +#define inline __inline +#endif + +#if defined(DEBUG) && !defined(_CRTDBG_MAP_ALLOC) +#define _CRTDBG_MAP_ALLOC +#endif + +#include +#include +#include +#include +#include +#include + +#ifndef LIB_API +#ifdef LIB_EXPORTS +#if defined(_MSC_VER) +#define LIB_API __declspec(dllexport) +#else +#define LIB_API __attribute__((visibility("default"))) +#endif +#else +#if defined(_MSC_VER) +#define LIB_API +#else +#define LIB_API +#endif +#endif +#endif + +#define SECRET_NUM -1234 + +typedef enum { UNUSED_DEF_VAL } UNUSED_ENUM_TYPE; + +#ifdef GPU + +#include +#include +#include + +#ifdef CUDNN +#include +#endif // CUDNN +#endif // GPU + +#ifdef __cplusplus +extern "C" { +#endif + +struct network; +typedef struct network network; + +struct network_state; +typedef struct network_state network_state; + +struct layer; +typedef struct layer layer; + +struct image; +typedef struct image image; + +struct detection; +typedef struct detection detection; + +struct load_args; +typedef struct load_args load_args; + +struct data; +typedef struct data data; + +struct metadata; +typedef struct metadata metadata; + +struct tree; +typedef struct tree tree; + +extern int gpu_index; + +// option_list.h +typedef struct metadata { + int classes; + char **names; +} metadata; + + +// tree.h +typedef struct tree { + int *leaf; + int n; + int *parent; + int *child; + int *group; + char **name; + + int groups; + int *group_size; + int *group_offset; +} tree; + + +// activations.h +typedef enum { + LOGISTIC, RELU, RELU6, RELIE, LINEAR, RAMP, TANH, PLSE, REVLEAKY, LEAKY, ELU, LOGGY, STAIR, HARDTAN, LHTAN, SELU, GELU, SWISH, MISH, HARD_MISH, NORM_CHAN, NORM_CHAN_SOFTMAX, NORM_CHAN_SOFTMAX_MAXVAL +}ACTIVATION; + +// parser.h +typedef enum { + IOU, GIOU, MSE, DIOU, CIOU +} IOU_LOSS; + +// parser.h +typedef enum { + DEFAULT_NMS, GREEDY_NMS, DIOU_NMS, CORNERS_NMS +} NMS_KIND; + +// parser.h +typedef enum { + YOLO_CENTER = 1 << 0, YOLO_LEFT_TOP = 1 << 1, YOLO_RIGHT_BOTTOM = 1 << 2 +} YOLO_POINT; + +// parser.h +typedef enum { + NO_WEIGHTS, PER_FEATURE, PER_CHANNEL +} WEIGHTS_TYPE_T; + +// parser.h +typedef enum { + NO_NORMALIZATION, RELU_NORMALIZATION, SOFTMAX_NORMALIZATION +} WEIGHTS_NORMALIZATION_T; + +// image.h +typedef enum{ + PNG, BMP, TGA, JPG +} IMTYPE; + +// activations.h +typedef enum{ + MULT, ADD, SUB, DIV +} BINARY_ACTIVATION; + +// blas.h +typedef struct contrastive_params { + float sim; + float exp_sim; + float P; + int i, j; + int time_step_i, time_step_j; +} contrastive_params; + + +// layer.h +typedef enum { + CONVOLUTIONAL, + DECONVOLUTIONAL, + CONNECTED, + MAXPOOL, + LOCAL_AVGPOOL, + SOFTMAX, + DETECTION, + DROPOUT, + CROP, + ROUTE, + COST, + NORMALIZATION, + AVGPOOL, + LOCAL, + SHORTCUT, + SCALE_CHANNELS, + SAM, + ACTIVE, + RNN, + GRU, + LSTM, + CONV_LSTM, + HISTORY, + CRNN, + BATCHNORM, + NETWORK, + XNOR, + REGION, + YOLO, + GAUSSIAN_YOLO, + ISEG, + REORG, + REORG_OLD, + UPSAMPLE, + LOGXENT, + L2NORM, + EMPTY, + BLANK, + CONTRASTIVE, + IMPLICIT +} LAYER_TYPE; + +// layer.h +typedef enum{ + SSE, MASKED, L1, SEG, SMOOTH,WGAN +} COST_TYPE; + +// layer.h +typedef struct update_args { + int batch; + float learning_rate; + float momentum; + float decay; + int adam; + float B1; + float B2; + float eps; + int t; +} update_args; + +// layer.h +struct layer { + LAYER_TYPE type; + ACTIVATION activation; + ACTIVATION lstm_activation; + COST_TYPE cost_type; + void(*forward) (struct layer, struct network_state); + void(*backward) (struct layer, struct network_state); + void(*update) (struct layer, int, float, float, float); + void(*forward_gpu) (struct layer, struct network_state); + void(*backward_gpu) (struct layer, struct network_state); + void(*update_gpu) (struct layer, int, float, float, float, float); + layer *share_layer; + int train; + int avgpool; + int batch_normalize; + int shortcut; + int batch; + int dynamic_minibatch; + int forced; + int flipped; + int inputs; + int outputs; + float mean_alpha; + int nweights; + int nbiases; + int extra; + int truths; + int h, w, c; + int out_h, out_w, out_c; + int n; + int max_boxes; + int truth_size; + int groups; + int group_id; + int size; + int side; + int stride; + int stride_x; + int stride_y; + int dilation; + int antialiasing; + int maxpool_depth; + int maxpool_zero_nonmax; + int out_channels; + float reverse; + int coordconv; + int flatten; + int spatial; + int pad; + int sqrt; + int flip; + int index; + int scale_wh; + int binary; + int xnor; + int peephole; + int use_bin_output; + int keep_delta_gpu; + int optimized_memory; + int steps; + int history_size; + int bottleneck; + float time_normalizer; + int state_constrain; + int hidden; + int truth; + float smooth; + float dot; + int deform; + int grad_centr; + int sway; + int rotate; + int stretch; + int stretch_sway; + float angle; + float jitter; + float resize; + float saturation; + float exposure; + float shift; + float ratio; + float learning_rate_scale; + float clip; + int focal_loss; + float *classes_multipliers; + float label_smooth_eps; + int noloss; + int softmax; + int classes; + int detection; + int embedding_layer_id; + float *embedding_output; + int embedding_size; + float sim_thresh; + int track_history_size; + int dets_for_track; + int dets_for_show; + float track_ciou_norm; + int coords; + int background; + int rescore; + int objectness; + int does_cost; + int joint; + int noadjust; + int reorg; + int log; + int tanh; + int *mask; + int total; + float bflops; + + int adam; + float B1; + float B2; + float eps; + + int t; + + float alpha; + float beta; + float kappa; + + float coord_scale; + float object_scale; + float noobject_scale; + float mask_scale; + float class_scale; + int bias_match; + float random; + float ignore_thresh; + float truth_thresh; + float iou_thresh; + float thresh; + float focus; + int classfix; + int absolute; + int assisted_excitation; + + int onlyforward; + int stopbackward; + int train_only_bn; + int dont_update; + int burnin_update; + int dontload; + int dontsave; + int dontloadscales; + int numload; + + float temperature; + float probability; + float dropblock_size_rel; + int dropblock_size_abs; + int dropblock; + float scale; + + int receptive_w; + int receptive_h; + int receptive_w_scale; + int receptive_h_scale; + + char * cweights; + int * indexes; + int * input_layers; + int * input_sizes; + float **layers_output; + float **layers_delta; + WEIGHTS_TYPE_T weights_type; + WEIGHTS_NORMALIZATION_T weights_normalization; + int * map; + int * counts; + float ** sums; + float * rand; + float * cost; + int *labels; + int *class_ids; + int contrastive_neg_max; + float *cos_sim; + float *exp_cos_sim; + float *p_constrastive; + contrastive_params *contrast_p_gpu; + float * state; + float * prev_state; + float * forgot_state; + float * forgot_delta; + float * state_delta; + float * combine_cpu; + float * combine_delta_cpu; + + float *concat; + float *concat_delta; + + float *binary_weights; + + float *biases; + float *bias_updates; + + float *scales; + float *scale_updates; + + float *weights_ema; + float *biases_ema; + float *scales_ema; + + float *weights; + float *weight_updates; + + float scale_x_y; + int objectness_smooth; + int new_coords; + int show_details; + float max_delta; + float uc_normalizer; + float iou_normalizer; + float obj_normalizer; + float cls_normalizer; + float delta_normalizer; + IOU_LOSS iou_loss; + IOU_LOSS iou_thresh_kind; + NMS_KIND nms_kind; + float beta_nms; + YOLO_POINT yolo_point; + + char *align_bit_weights_gpu; + float *mean_arr_gpu; + float *align_workspace_gpu; + float *transposed_align_workspace_gpu; + int align_workspace_size; + + char *align_bit_weights; + float *mean_arr; + int align_bit_weights_size; + int lda_align; + int new_lda; + int bit_align; + + float *col_image; + float * delta; + float * output; + float * activation_input; + int delta_pinned; + int output_pinned; + float * loss; + float * squared; + float * norms; + + float * spatial_mean; + float * mean; + float * variance; + + float * mean_delta; + float * variance_delta; + + float * rolling_mean; + float * rolling_variance; + + float * x; + float * x_norm; + + float * m; + float * v; + + float * bias_m; + float * bias_v; + float * scale_m; + float * scale_v; + + + float *z_cpu; + float *r_cpu; + float *h_cpu; + float *stored_h_cpu; + float * prev_state_cpu; + + float *temp_cpu; + float *temp2_cpu; + float *temp3_cpu; + + float *dh_cpu; + float *hh_cpu; + float *prev_cell_cpu; + float *cell_cpu; + float *f_cpu; + float *i_cpu; + float *g_cpu; + float *o_cpu; + float *c_cpu; + float *stored_c_cpu; + float *dc_cpu; + + float *binary_input; + uint32_t *bin_re_packed_input; + char *t_bit_input; + + struct layer *input_layer; + struct layer *self_layer; + struct layer *output_layer; + + struct layer *reset_layer; + struct layer *update_layer; + struct layer *state_layer; + + struct layer *input_gate_layer; + struct layer *state_gate_layer; + struct layer *input_save_layer; + struct layer *state_save_layer; + struct layer *input_state_layer; + struct layer *state_state_layer; + + struct layer *input_z_layer; + struct layer *state_z_layer; + + struct layer *input_r_layer; + struct layer *state_r_layer; + + struct layer *input_h_layer; + struct layer *state_h_layer; + + struct layer *wz; + struct layer *uz; + struct layer *wr; + struct layer *ur; + struct layer *wh; + struct layer *uh; + struct layer *uo; + struct layer *wo; + struct layer *vo; + struct layer *uf; + struct layer *wf; + struct layer *vf; + struct layer *ui; + struct layer *wi; + struct layer *vi; + struct layer *ug; + struct layer *wg; + + tree *softmax_tree; + + size_t workspace_size; + +//#ifdef GPU + int *indexes_gpu; + + int stream; + int wait_stream_id; + + float *z_gpu; + float *r_gpu; + float *h_gpu; + float *stored_h_gpu; + float *bottelneck_hi_gpu; + float *bottelneck_delta_gpu; + + float *temp_gpu; + float *temp2_gpu; + float *temp3_gpu; + + float *dh_gpu; + float *hh_gpu; + float *prev_cell_gpu; + float *prev_state_gpu; + float *last_prev_state_gpu; + float *last_prev_cell_gpu; + float *cell_gpu; + float *f_gpu; + float *i_gpu; + float *g_gpu; + float *o_gpu; + float *c_gpu; + float *stored_c_gpu; + float *dc_gpu; + + // adam + float *m_gpu; + float *v_gpu; + float *bias_m_gpu; + float *scale_m_gpu; + float *bias_v_gpu; + float *scale_v_gpu; + + float * combine_gpu; + float * combine_delta_gpu; + + float * forgot_state_gpu; + float * forgot_delta_gpu; + float * state_gpu; + float * state_delta_gpu; + float * gate_gpu; + float * gate_delta_gpu; + float * save_gpu; + float * save_delta_gpu; + float * concat_gpu; + float * concat_delta_gpu; + + float *binary_input_gpu; + float *binary_weights_gpu; + float *bin_conv_shortcut_in_gpu; + float *bin_conv_shortcut_out_gpu; + + float * mean_gpu; + float * variance_gpu; + float * m_cbn_avg_gpu; + float * v_cbn_avg_gpu; + + float * rolling_mean_gpu; + float * rolling_variance_gpu; + + float * variance_delta_gpu; + float * mean_delta_gpu; + + float * col_image_gpu; + + float * x_gpu; + float * x_norm_gpu; + float * weights_gpu; + float * weight_updates_gpu; + float * weight_deform_gpu; + float * weight_change_gpu; + + float * weights_gpu16; + float * weight_updates_gpu16; + + float * biases_gpu; + float * bias_updates_gpu; + float * bias_change_gpu; + + float * scales_gpu; + float * scale_updates_gpu; + float * scale_change_gpu; + + float * input_antialiasing_gpu; + float * output_gpu; + float * output_avg_gpu; + float * activation_input_gpu; + float * loss_gpu; + float * delta_gpu; + float * cos_sim_gpu; + float * rand_gpu; + float * drop_blocks_scale; + float * drop_blocks_scale_gpu; + float * squared_gpu; + float * norms_gpu; + + float *gt_gpu; + float *a_avg_gpu; + + int *input_sizes_gpu; + float **layers_output_gpu; + float **layers_delta_gpu; +#ifdef CUDNN + cudnnTensorDescriptor_t srcTensorDesc, dstTensorDesc; + cudnnTensorDescriptor_t srcTensorDesc16, dstTensorDesc16; + cudnnTensorDescriptor_t dsrcTensorDesc, ddstTensorDesc; + cudnnTensorDescriptor_t dsrcTensorDesc16, ddstTensorDesc16; + cudnnTensorDescriptor_t normTensorDesc, normDstTensorDesc, normDstTensorDescF16; + cudnnFilterDescriptor_t weightDesc, weightDesc16; + cudnnFilterDescriptor_t dweightDesc, dweightDesc16; + cudnnConvolutionDescriptor_t convDesc; + cudnnConvolutionFwdAlgo_t fw_algo, fw_algo16; + cudnnConvolutionBwdDataAlgo_t bd_algo, bd_algo16; + cudnnConvolutionBwdFilterAlgo_t bf_algo, bf_algo16; + cudnnPoolingDescriptor_t poolingDesc; +#else // CUDNN + void* srcTensorDesc, *dstTensorDesc; + void* srcTensorDesc16, *dstTensorDesc16; + void* dsrcTensorDesc, *ddstTensorDesc; + void* dsrcTensorDesc16, *ddstTensorDesc16; + void* normTensorDesc, *normDstTensorDesc, *normDstTensorDescF16; + void* weightDesc, *weightDesc16; + void* dweightDesc, *dweightDesc16; + void* convDesc; + UNUSED_ENUM_TYPE fw_algo, fw_algo16; + UNUSED_ENUM_TYPE bd_algo, bd_algo16; + UNUSED_ENUM_TYPE bf_algo, bf_algo16; + void* poolingDesc; +#endif // CUDNN +//#endif // GPU +}; + + +// network.h +typedef enum { + CONSTANT, STEP, EXP, POLY, STEPS, SIG, RANDOM, SGDR +} learning_rate_policy; + +// network.h +typedef struct network { + int n; + int batch; + uint64_t *seen; + float *badlabels_reject_threshold; + float *delta_rolling_max; + float *delta_rolling_avg; + float *delta_rolling_std; + int weights_reject_freq; + int equidistant_point; + float badlabels_rejection_percentage; + float num_sigmas_reject_badlabels; + float ema_alpha; + int *cur_iteration; + float loss_scale; + int *t; + float epoch; + int subdivisions; + layer *layers; + float *output; + learning_rate_policy policy; + int benchmark_layers; + int *total_bbox; + int *rewritten_bbox; + + float learning_rate; + float learning_rate_min; + float learning_rate_max; + int batches_per_cycle; + int batches_cycle_mult; + float momentum; + float decay; + float gamma; + float scale; + float power; + int time_steps; + int step; + int max_batches; + int num_boxes; + int train_images_num; + float *seq_scales; + float *scales; + int *steps; + int num_steps; + int burn_in; + int cudnn_half; + + int adam; + float B1; + float B2; + float eps; + + int inputs; + int outputs; + int truths; + int notruth; + int h, w, c; + int max_crop; + int min_crop; + float max_ratio; + float min_ratio; + int center; + int flip; // horizontal flip 50% probability augmentaiont for classifier training (default = 1) + int gaussian_noise; + int blur; + int mixup; + float label_smooth_eps; + int resize_step; + int attention; + int adversarial; + float adversarial_lr; + float max_chart_loss; + int letter_box; + int mosaic_bound; + int contrastive; + int contrastive_jit_flip; + int contrastive_color; + int unsupervised; + float angle; + float aspect; + float exposure; + float saturation; + float hue; + int random; + int track; + int augment_speed; + int sequential_subdivisions; + int init_sequential_subdivisions; + int current_subdivision; + int try_fix_nan; + + int gpu_index; + tree *hierarchy; + + float *input; + float *truth; + float *delta; + float *workspace; + int train; + int index; + float *cost; + float clip; + +//#ifdef GPU + //float *input_gpu; + //float *truth_gpu; + float *delta_gpu; + float *output_gpu; + + float *input_state_gpu; + float *input_pinned_cpu; + int input_pinned_cpu_flag; + + float **input_gpu; + float **truth_gpu; + float **input16_gpu; + float **output16_gpu; + size_t *max_input16_size; + size_t *max_output16_size; + int wait_stream; + + void *cuda_graph; + void *cuda_graph_exec; + int use_cuda_graph; + int *cuda_graph_ready; + + float *global_delta_gpu; + float *state_delta_gpu; + size_t max_delta_gpu_size; +//#endif // GPU + int optimized_memory; + int dynamic_minibatch; + size_t workspace_size_limit; +} network; + +// network.h +typedef struct network_state { + float *truth; + float *input; + float *delta; + float *workspace; + int train; + int index; + network net; +} network_state; + +//typedef struct { +// int w; +// int h; +// float scale; +// float rad; +// float dx; +// float dy; +// float aspect; +//} augment_args; + +// image.h +typedef struct image { + int w; + int h; + int c; + float *data; +} image; + +//typedef struct { +// int w; +// int h; +// int c; +// float *data; +//} image; + +// box.h +typedef struct box { + float x, y, w, h; +} box; + +// box.h +typedef struct boxabs { + float left, right, top, bot; +} boxabs; + +// box.h +typedef struct dxrep { + float dt, db, dl, dr; +} dxrep; + +// box.h +typedef struct ious { + float iou, giou, diou, ciou; + dxrep dx_iou; + dxrep dx_giou; +} ious; + + +// box.h +typedef struct detection{ + box bbox; + int classes; + int best_class_idx; + float *prob; + float *mask; + float objectness; + int sort_class; + float *uc; // Gaussian_YOLOv3 - tx,ty,tw,th uncertainty + int points; // bit-0 - center, bit-1 - top-left-corner, bit-2 - bottom-right-corner + float *embeddings; // embeddings for tracking + int embedding_size; + float sim; + int track_id; +} detection; + +// network.c -batch inference +typedef struct det_num_pair { + int num; + detection *dets; +} det_num_pair, *pdet_num_pair; + +// matrix.h +typedef struct matrix { + int rows, cols; + float **vals; +} matrix; + +// data.h +typedef struct data { + int w, h; + matrix X; + matrix y; + int shallow; + int *num_boxes; + box **boxes; +} data; + +// data.h +typedef enum { + CLASSIFICATION_DATA, DETECTION_DATA, CAPTCHA_DATA, REGION_DATA, IMAGE_DATA, COMPARE_DATA, WRITING_DATA, SWAG_DATA, TAG_DATA, OLD_CLASSIFICATION_DATA, STUDY_DATA, DET_DATA, SUPER_DATA, LETTERBOX_DATA, REGRESSION_DATA, SEGMENTATION_DATA, INSTANCE_DATA, ISEG_DATA +} data_type; + +// data.h +typedef struct load_args { + int threads; + char **paths; + char *path; + int n; + int m; + char **labels; + int h; + int w; + int c; // color depth + int out_w; + int out_h; + int nh; + int nw; + int num_boxes; + int truth_size; + int min, max, size; + int classes; + int background; + int scale; + int center; + int coords; + int mini_batch; + int track; + int augment_speed; + int letter_box; + int mosaic_bound; + int show_imgs; + int dontuse_opencv; + int contrastive; + int contrastive_jit_flip; + int contrastive_color; + float jitter; + float resize; + int flip; + int gaussian_noise; + int blur; + int mixup; + float label_smooth_eps; + float angle; + float aspect; + float saturation; + float exposure; + float hue; + data *d; + image *im; + image *resized; + data_type type; + tree *hierarchy; +} load_args; + +// data.h +typedef struct box_label { + int id; + int track_id; + float x, y, w, h; + float left, right, top, bottom; +} box_label; + +// list.h +//typedef struct node { +// void *val; +// struct node *next; +// struct node *prev; +//} node; + +// list.h +//typedef struct list { +// int size; +// node *front; +// node *back; +//} list; +// ----------------------------------------------------- + + +// parser.c +LIB_API network *load_network(char *cfg, char *weights, int clear); +LIB_API network *load_network_custom(char *cfg, char *weights, int clear, int batch); +LIB_API void free_network(network net); +LIB_API void free_network_ptr(network* net); + +// network.c +LIB_API load_args get_base_args(network *net); + +// box.h +LIB_API void do_nms_sort(detection *dets, int total, int classes, float thresh); +LIB_API void do_nms_obj(detection *dets, int total, int classes, float thresh); +LIB_API void diounms_sort(detection *dets, int total, int classes, float thresh, NMS_KIND nms_kind, float beta1); + +// network.h +LIB_API float *network_predict(network net, float *input); +LIB_API float *network_predict_ptr(network *net, float *input); +#ifdef CUDA_OPENGL_INTEGRATION +LIB_API float *network_predict_gl_texture(network *net, uint32_t texture_id); +#endif // CUDA_OPENGL_INTEGRATION + +LIB_API void set_batch_network(network *net, int b); +LIB_API detection *get_network_boxes(network *net, int w, int h, float thresh, float hier, int *map, int relative, int *num, int letter); +LIB_API det_num_pair* network_predict_batch(network *net, image im, int batch_size, int w, int h, float thresh, float hier, int *map, int relative, int letter); +LIB_API void free_detections(detection *dets, int n); +LIB_API void free_batch_detections(det_num_pair *det_num_pairs, int n); +LIB_API void fuse_conv_batchnorm(network net); +LIB_API void calculate_binary_weights(network net); +LIB_API char *detection_to_json(detection *dets, int nboxes, int classes, char **names, long long int frame_id, char *filename); + +LIB_API layer* get_network_layer(network* net, int i); +//LIB_API detection *get_network_boxes(network *net, int w, int h, float thresh, float hier, int *map, int relative, int *num, int letter); +LIB_API detection *make_network_boxes(network *net, float thresh, int *num); +LIB_API void reset_rnn(network *net); +LIB_API float *network_predict_image(network *net, image im); +LIB_API float *network_predict_image_letterbox(network *net, image im); +LIB_API float validate_detector_map(char *datacfg, char *cfgfile, char *weightfile, float thresh_calc_avg_iou, const float iou_thresh, const int map_points, int letter_box, network *existing_net); +LIB_API void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, int ngpus, int clear, int dont_show, int calc_map, float thresh, float iou_thresh, int mjpeg_port, int show_imgs, int benchmark_layers, char* chart_path, int mAP_epochs); +LIB_API void test_detector(char *datacfg, char *cfgfile, char *weightfile, char *filename, float thresh, + float hier_thresh, int dont_show, int ext_output, int save_labels, char *outfile, int letter_box, int benchmark_layers); +LIB_API int network_width(network *net); +LIB_API int network_height(network *net); +LIB_API void optimize_picture(network *net, image orig, int max_layer, float scale, float rate, float thresh, int norm); + +// image.h +LIB_API void make_image_red(image im); +LIB_API image make_attention_image(int img_size, float *original_delta_cpu, float *original_input_cpu, int w, int h, int c, float alpha); +LIB_API image resize_image(image im, int w, int h); +LIB_API void quantize_image(image im); +LIB_API void copy_image_from_bytes(image im, char *pdata); +LIB_API image letterbox_image(image im, int w, int h); +LIB_API void rgbgr_image(image im); +LIB_API image make_image(int w, int h, int c); +LIB_API image load_image_color(char *filename, int w, int h); +LIB_API void free_image(image m); +LIB_API image crop_image(image im, int dx, int dy, int w, int h); +LIB_API image resize_min(image im, int min); + +// layer.h +LIB_API void free_layer_custom(layer l, int keep_cudnn_desc); +LIB_API void free_layer(layer l); + +// data.c +LIB_API void free_data(data d); +LIB_API pthread_t load_data(load_args args); +LIB_API void free_load_threads(void *ptr); +LIB_API pthread_t load_data_in_thread(load_args args); +LIB_API void *load_thread(void *ptr); + +// dark_cuda.h +LIB_API void cuda_pull_array(float *x_gpu, float *x, size_t n); +LIB_API void cuda_pull_array_async(float *x_gpu, float *x, size_t n); +LIB_API void cuda_set_device(int n); +LIB_API void *cuda_get_context(); + +// utils.h +LIB_API void free_ptrs(void **ptrs, int n); +LIB_API void top_k(float *a, int n, int k, int *index); + +// tree.h +LIB_API tree *read_tree(char *filename); + +// option_list.h +LIB_API metadata get_metadata(char *file); + + +// http_stream.h +LIB_API void delete_json_sender(); +LIB_API void send_json_custom(char const* send_buf, int port, int timeout); +LIB_API double get_time_point(); +void start_timer(); +void stop_timer(); +double get_time(); +void stop_timer_and_show(); +void stop_timer_and_show_name(char *name); +void show_total_time(); + +LIB_API void set_track_id(detection *new_dets, int new_dets_num, float thresh, float sim_thresh, float track_ciou_norm, int deque_size, int dets_for_track, int dets_for_show); +LIB_API int fill_remaining_id(detection *new_dets, int new_dets_num, int new_track_id, float thresh); + + +// gemm.h +LIB_API void init_cpu(); + +#ifdef __cplusplus +} +#endif // __cplusplus +#endif // DARKNET_API diff --git a/include/yolov4/yolo_v2_class.hpp b/include/yolov4/yolo_v2_class.hpp new file mode 100644 index 0000000..7345828 --- /dev/null +++ b/include/yolov4/yolo_v2_class.hpp @@ -0,0 +1,1054 @@ +#ifndef YOLO_V2_CLASS_HPP +#define YOLO_V2_CLASS_HPP + +#ifndef LIB_API +#ifdef LIB_EXPORTS +#if defined(_MSC_VER) +#define LIB_API __declspec(dllexport) +#else +#define LIB_API __attribute__((visibility("default"))) +#endif +#else +#if defined(_MSC_VER) +#define LIB_API +#else +#define LIB_API +#endif +#endif +#endif + + +#define C_SHARP_MAX_OBJECTS 1000 + +struct bbox_t { + unsigned int x, y, w, h; // (x,y) - top-left corner, (w, h) - width & height of bounded box + float prob; // confidence - probability that the object was found correctly + unsigned int obj_id; // class of object - from range [0, classes-1] + unsigned int track_id; // tracking id for video (0 - untracked, 1 - inf - tracked object) + unsigned int frames_counter; // counter of frames on which the object was detected + float x_3d, y_3d, z_3d; // center of object (in Meters) if ZED 3D Camera is used +}; + +struct image_t { + int h; // height + int w; // width + int c; // number of chanels (3 - for RGB) + float *data; // pointer to the image data +}; + +struct bbox_t_container { + bbox_t candidates[C_SHARP_MAX_OBJECTS]; +}; + +#ifdef __cplusplus +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef OPENCV +#include // C++ +#include // C +#include // C +#endif + +extern "C" LIB_API int init(const char *configurationFilename, const char *weightsFilename, int gpu, int batch_size); +extern "C" LIB_API int detect_image(const char *filename, bbox_t_container &container); +extern "C" LIB_API int detect_mat(const uint8_t* data, const size_t data_length, bbox_t_container &container); +extern "C" LIB_API int dispose(); +extern "C" LIB_API int get_device_count(); +extern "C" LIB_API int get_device_name(int gpu, char* deviceName); +extern "C" LIB_API bool built_with_cuda(); +extern "C" LIB_API bool built_with_cudnn(); +extern "C" LIB_API bool built_with_opencv(); +extern "C" LIB_API void send_json_custom(char const* send_buf, int port, int timeout); + +class Detector { + std::shared_ptr detector_gpu_ptr; + std::deque> prev_bbox_vec_deque; + std::string _cfg_filename, _weight_filename; +public: + const int cur_gpu_id; + float nms = .4; + bool wait_stream; + + LIB_API Detector(std::string cfg_filename, std::string weight_filename, int gpu_id = 0, int batch_size = 1); + LIB_API ~Detector(); + + LIB_API std::vector detect(std::string image_filename, float thresh = 0.2, bool use_mean = false); + LIB_API std::vector detect(image_t img, float thresh = 0.2, bool use_mean = false); + LIB_API std::vector> detectBatch(image_t img, int batch_size, int width, int height, float thresh, bool make_nms = true); + static LIB_API image_t load_image(std::string image_filename); + static LIB_API void free_image(image_t m); + LIB_API int get_net_width() const; + LIB_API int get_net_height() const; + LIB_API int get_net_color_depth() const; + + LIB_API std::vector tracking_id(std::vector cur_bbox_vec, bool const change_history = true, + int const frames_story = 5, int const max_dist = 40); + + LIB_API void *get_cuda_context(); + + //LIB_API bool send_json_http(std::vector cur_bbox_vec, std::vector obj_names, int frame_id, + // std::string filename = std::string(), int timeout = 400000, int port = 8070); + + std::vector detect_resized(image_t img, int init_w, int init_h, float thresh = 0.2, bool use_mean = false) + { + if (img.data == NULL) + throw std::runtime_error("Image is empty"); + auto detection_boxes = detect(img, thresh, use_mean); + float wk = (float)init_w / img.w, hk = (float)init_h / img.h; + for (auto &i : detection_boxes) i.x *= wk, i.w *= wk, i.y *= hk, i.h *= hk; + return detection_boxes; + } + +#ifdef OPENCV + std::vector detect(cv::Mat mat, float thresh = 0.2, bool use_mean = false) + { + if(mat.data == NULL) + throw std::runtime_error("Image is empty"); + auto image_ptr = mat_to_image_resize(mat); + return detect_resized(*image_ptr, mat.cols, mat.rows, thresh, use_mean); + } + + std::shared_ptr mat_to_image_resize(cv::Mat mat) const + { + if (mat.data == NULL) return std::shared_ptr(NULL); + + cv::Size network_size = cv::Size(get_net_width(), get_net_height()); + cv::Mat det_mat; + if (mat.size() != network_size) + cv::resize(mat, det_mat, network_size); + else + det_mat = mat; // only reference is copied + + return mat_to_image(det_mat); + } + + static std::shared_ptr mat_to_image(cv::Mat img_src) + { + cv::Mat img; + if (img_src.channels() == 4) cv::cvtColor(img_src, img, cv::COLOR_RGBA2BGR); + else if (img_src.channels() == 3) cv::cvtColor(img_src, img, cv::COLOR_RGB2BGR); + else if (img_src.channels() == 1) cv::cvtColor(img_src, img, cv::COLOR_GRAY2BGR); + else std::cerr << " Warning: img_src.channels() is not 1, 3 or 4. It is = " << img_src.channels() << std::endl; + std::shared_ptr image_ptr(new image_t, [](image_t *img) { free_image(*img); delete img; }); + *image_ptr = mat_to_image_custom(img); + return image_ptr; + } + +private: + + static image_t mat_to_image_custom(cv::Mat mat) + { + int w = mat.cols; + int h = mat.rows; + int c = mat.channels(); + image_t im = make_image_custom(w, h, c); + unsigned char *data = (unsigned char *)mat.data; + int step = mat.step; + for (int y = 0; y < h; ++y) { + for (int k = 0; k < c; ++k) { + for (int x = 0; x < w; ++x) { + im.data[k*w*h + y*w + x] = data[y*step + x*c + k] / 255.0f; + } + } + } + return im; + } + + static image_t make_empty_image(int w, int h, int c) + { + image_t out; + out.data = 0; + out.h = h; + out.w = w; + out.c = c; + return out; + } + + static image_t make_image_custom(int w, int h, int c) + { + image_t out = make_empty_image(w, h, c); + out.data = (float *)calloc(h*w*c, sizeof(float)); + return out; + } + +#endif // OPENCV + +public: + + bool send_json_http(std::vector cur_bbox_vec, std::vector obj_names, int frame_id, + std::string filename = std::string(), int timeout = 400000, int port = 8070) + { + std::string send_str; + + char *tmp_buf = (char *)calloc(1024, sizeof(char)); + if (!filename.empty()) { + sprintf(tmp_buf, "{\n \"frame_id\":%d, \n \"filename\":\"%s\", \n \"objects\": [ \n", frame_id, filename.c_str()); + } + else { + sprintf(tmp_buf, "{\n \"frame_id\":%d, \n \"objects\": [ \n", frame_id); + } + send_str = tmp_buf; + free(tmp_buf); + + for (auto & i : cur_bbox_vec) { + char *buf = (char *)calloc(2048, sizeof(char)); + + sprintf(buf, " {\"class_id\":%d, \"name\":\"%s\", \"absolute_coordinates\":{\"center_x\":%d, \"center_y\":%d, \"width\":%d, \"height\":%d}, \"confidence\":%f", + i.obj_id, obj_names[i.obj_id].c_str(), i.x, i.y, i.w, i.h, i.prob); + + //sprintf(buf, " {\"class_id\":%d, \"name\":\"%s\", \"relative_coordinates\":{\"center_x\":%f, \"center_y\":%f, \"width\":%f, \"height\":%f}, \"confidence\":%f", + // i.obj_id, obj_names[i.obj_id], i.x, i.y, i.w, i.h, i.prob); + + send_str += buf; + + if (!std::isnan(i.z_3d)) { + sprintf(buf, "\n , \"coordinates_in_meters\":{\"x_3d\":%.2f, \"y_3d\":%.2f, \"z_3d\":%.2f}", + i.x_3d, i.y_3d, i.z_3d); + send_str += buf; + } + + send_str += "}\n"; + + free(buf); + } + + //send_str += "\n ] \n}, \n"; + send_str += "\n ] \n}"; + + send_json_custom(send_str.c_str(), port, timeout); + return true; + } +}; +// -------------------------------------------------------------------------------- + + +#if defined(TRACK_OPTFLOW) && defined(OPENCV) && defined(GPU) + +#include +#include +#include +#include + +class Tracker_optflow { +public: + const int gpu_count; + const int gpu_id; + const int flow_error; + + + Tracker_optflow(int _gpu_id = 0, int win_size = 15, int max_level = 3, int iterations = 8000, int _flow_error = -1) : + gpu_count(cv::cuda::getCudaEnabledDeviceCount()), gpu_id(std::min(_gpu_id, gpu_count-1)), + flow_error((_flow_error > 0)? _flow_error:(win_size*4)) + { + int const old_gpu_id = cv::cuda::getDevice(); + cv::cuda::setDevice(gpu_id); + + stream = cv::cuda::Stream(); + + sync_PyrLKOpticalFlow_gpu = cv::cuda::SparsePyrLKOpticalFlow::create(); + sync_PyrLKOpticalFlow_gpu->setWinSize(cv::Size(win_size, win_size)); // 9, 15, 21, 31 + sync_PyrLKOpticalFlow_gpu->setMaxLevel(max_level); // +- 3 pt + sync_PyrLKOpticalFlow_gpu->setNumIters(iterations); // 2000, def: 30 + + cv::cuda::setDevice(old_gpu_id); + } + + // just to avoid extra allocations + cv::cuda::GpuMat src_mat_gpu; + cv::cuda::GpuMat dst_mat_gpu, dst_grey_gpu; + cv::cuda::GpuMat prev_pts_flow_gpu, cur_pts_flow_gpu; + cv::cuda::GpuMat status_gpu, err_gpu; + + cv::cuda::GpuMat src_grey_gpu; // used in both functions + cv::Ptr sync_PyrLKOpticalFlow_gpu; + cv::cuda::Stream stream; + + std::vector cur_bbox_vec; + std::vector good_bbox_vec_flags; + cv::Mat prev_pts_flow_cpu; + + void update_cur_bbox_vec(std::vector _cur_bbox_vec) + { + cur_bbox_vec = _cur_bbox_vec; + good_bbox_vec_flags = std::vector(cur_bbox_vec.size(), true); + cv::Mat prev_pts, cur_pts_flow_cpu; + + for (auto &i : cur_bbox_vec) { + float x_center = (i.x + i.w / 2.0F); + float y_center = (i.y + i.h / 2.0F); + prev_pts.push_back(cv::Point2f(x_center, y_center)); + } + + if (prev_pts.rows == 0) + prev_pts_flow_cpu = cv::Mat(); + else + cv::transpose(prev_pts, prev_pts_flow_cpu); + + if (prev_pts_flow_gpu.cols < prev_pts_flow_cpu.cols) { + prev_pts_flow_gpu = cv::cuda::GpuMat(prev_pts_flow_cpu.size(), prev_pts_flow_cpu.type()); + cur_pts_flow_gpu = cv::cuda::GpuMat(prev_pts_flow_cpu.size(), prev_pts_flow_cpu.type()); + + status_gpu = cv::cuda::GpuMat(prev_pts_flow_cpu.size(), CV_8UC1); + err_gpu = cv::cuda::GpuMat(prev_pts_flow_cpu.size(), CV_32FC1); + } + + prev_pts_flow_gpu.upload(cv::Mat(prev_pts_flow_cpu), stream); + } + + + void update_tracking_flow(cv::Mat src_mat, std::vector _cur_bbox_vec) + { + int const old_gpu_id = cv::cuda::getDevice(); + if (old_gpu_id != gpu_id) + cv::cuda::setDevice(gpu_id); + + if (src_mat.channels() == 1 || src_mat.channels() == 3 || src_mat.channels() == 4) { + if (src_mat_gpu.cols == 0) { + src_mat_gpu = cv::cuda::GpuMat(src_mat.size(), src_mat.type()); + src_grey_gpu = cv::cuda::GpuMat(src_mat.size(), CV_8UC1); + } + + if (src_mat.channels() == 1) { + src_mat_gpu.upload(src_mat, stream); + src_mat_gpu.copyTo(src_grey_gpu); + } + else if (src_mat.channels() == 3) { + src_mat_gpu.upload(src_mat, stream); + cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGR2GRAY, 1, stream); + } + else if (src_mat.channels() == 4) { + src_mat_gpu.upload(src_mat, stream); + cv::cuda::cvtColor(src_mat_gpu, src_grey_gpu, CV_BGRA2GRAY, 1, stream); + } + else { + std::cerr << " Warning: src_mat.channels() is not: 1, 3 or 4. It is = " << src_mat.channels() << " \n"; + return; + } + + } + update_cur_bbox_vec(_cur_bbox_vec); + + if (old_gpu_id != gpu_id) + cv::cuda::setDevice(old_gpu_id); + } + + + std::vector tracking_flow(cv::Mat dst_mat, bool check_error = true) + { + if (sync_PyrLKOpticalFlow_gpu.empty()) { + std::cout << "sync_PyrLKOpticalFlow_gpu isn't initialized \n"; + return cur_bbox_vec; + } + + int const old_gpu_id = cv::cuda::getDevice(); + if(old_gpu_id != gpu_id) + cv::cuda::setDevice(gpu_id); + + if (dst_mat_gpu.cols == 0) { + dst_mat_gpu = cv::cuda::GpuMat(dst_mat.size(), dst_mat.type()); + dst_grey_gpu = cv::cuda::GpuMat(dst_mat.size(), CV_8UC1); + } + + //dst_grey_gpu.upload(dst_mat, stream); // use BGR + dst_mat_gpu.upload(dst_mat, stream); + cv::cuda::cvtColor(dst_mat_gpu, dst_grey_gpu, CV_BGR2GRAY, 1, stream); + + if (src_grey_gpu.rows != dst_grey_gpu.rows || src_grey_gpu.cols != dst_grey_gpu.cols) { + stream.waitForCompletion(); + src_grey_gpu = dst_grey_gpu.clone(); + cv::cuda::setDevice(old_gpu_id); + return cur_bbox_vec; + } + + ////sync_PyrLKOpticalFlow_gpu.sparse(src_grey_gpu, dst_grey_gpu, prev_pts_flow_gpu, cur_pts_flow_gpu, status_gpu, &err_gpu); // OpenCV 2.4.x + sync_PyrLKOpticalFlow_gpu->calc(src_grey_gpu, dst_grey_gpu, prev_pts_flow_gpu, cur_pts_flow_gpu, status_gpu, err_gpu, stream); // OpenCV 3.x + + cv::Mat cur_pts_flow_cpu; + cur_pts_flow_gpu.download(cur_pts_flow_cpu, stream); + + dst_grey_gpu.copyTo(src_grey_gpu, stream); + + cv::Mat err_cpu, status_cpu; + err_gpu.download(err_cpu, stream); + status_gpu.download(status_cpu, stream); + + stream.waitForCompletion(); + + std::vector result_bbox_vec; + + if (err_cpu.cols == cur_bbox_vec.size() && status_cpu.cols == cur_bbox_vec.size()) + { + for (size_t i = 0; i < cur_bbox_vec.size(); ++i) + { + cv::Point2f cur_key_pt = cur_pts_flow_cpu.at(0, i); + cv::Point2f prev_key_pt = prev_pts_flow_cpu.at(0, i); + + float moved_x = cur_key_pt.x - prev_key_pt.x; + float moved_y = cur_key_pt.y - prev_key_pt.y; + + if (abs(moved_x) < 100 && abs(moved_y) < 100 && good_bbox_vec_flags[i]) + if (err_cpu.at(0, i) < flow_error && status_cpu.at(0, i) != 0 && + ((float)cur_bbox_vec[i].x + moved_x) > 0 && ((float)cur_bbox_vec[i].y + moved_y) > 0) + { + cur_bbox_vec[i].x += moved_x + 0.5; + cur_bbox_vec[i].y += moved_y + 0.5; + result_bbox_vec.push_back(cur_bbox_vec[i]); + } + else good_bbox_vec_flags[i] = false; + else good_bbox_vec_flags[i] = false; + + //if(!check_error && !good_bbox_vec_flags[i]) result_bbox_vec.push_back(cur_bbox_vec[i]); + } + } + + cur_pts_flow_gpu.swap(prev_pts_flow_gpu); + cur_pts_flow_cpu.copyTo(prev_pts_flow_cpu); + + if (old_gpu_id != gpu_id) + cv::cuda::setDevice(old_gpu_id); + + return result_bbox_vec; + } + +}; + +#elif defined(TRACK_OPTFLOW) && defined(OPENCV) + +//#include +#include + +class Tracker_optflow { +public: + const int flow_error; + + + Tracker_optflow(int win_size = 15, int max_level = 3, int iterations = 8000, int _flow_error = -1) : + flow_error((_flow_error > 0)? _flow_error:(win_size*4)) + { + sync_PyrLKOpticalFlow = cv::SparsePyrLKOpticalFlow::create(); + sync_PyrLKOpticalFlow->setWinSize(cv::Size(win_size, win_size)); // 9, 15, 21, 31 + sync_PyrLKOpticalFlow->setMaxLevel(max_level); // +- 3 pt + + } + + // just to avoid extra allocations + cv::Mat dst_grey; + cv::Mat prev_pts_flow, cur_pts_flow; + cv::Mat status, err; + + cv::Mat src_grey; // used in both functions + cv::Ptr sync_PyrLKOpticalFlow; + + std::vector cur_bbox_vec; + std::vector good_bbox_vec_flags; + + void update_cur_bbox_vec(std::vector _cur_bbox_vec) + { + cur_bbox_vec = _cur_bbox_vec; + good_bbox_vec_flags = std::vector(cur_bbox_vec.size(), true); + cv::Mat prev_pts, cur_pts_flow; + + for (auto &i : cur_bbox_vec) { + float x_center = (i.x + i.w / 2.0F); + float y_center = (i.y + i.h / 2.0F); + prev_pts.push_back(cv::Point2f(x_center, y_center)); + } + + if (prev_pts.rows == 0) + prev_pts_flow = cv::Mat(); + else + cv::transpose(prev_pts, prev_pts_flow); + } + + + void update_tracking_flow(cv::Mat new_src_mat, std::vector _cur_bbox_vec) + { + if (new_src_mat.channels() == 1) { + src_grey = new_src_mat.clone(); + } + else if (new_src_mat.channels() == 3) { + cv::cvtColor(new_src_mat, src_grey, CV_BGR2GRAY, 1); + } + else if (new_src_mat.channels() == 4) { + cv::cvtColor(new_src_mat, src_grey, CV_BGRA2GRAY, 1); + } + else { + std::cerr << " Warning: new_src_mat.channels() is not: 1, 3 or 4. It is = " << new_src_mat.channels() << " \n"; + return; + } + update_cur_bbox_vec(_cur_bbox_vec); + } + + + std::vector tracking_flow(cv::Mat new_dst_mat, bool check_error = true) + { + if (sync_PyrLKOpticalFlow.empty()) { + std::cout << "sync_PyrLKOpticalFlow isn't initialized \n"; + return cur_bbox_vec; + } + + cv::cvtColor(new_dst_mat, dst_grey, CV_BGR2GRAY, 1); + + if (src_grey.rows != dst_grey.rows || src_grey.cols != dst_grey.cols) { + src_grey = dst_grey.clone(); + //std::cerr << " Warning: src_grey.rows != dst_grey.rows || src_grey.cols != dst_grey.cols \n"; + return cur_bbox_vec; + } + + if (prev_pts_flow.cols < 1) { + return cur_bbox_vec; + } + + ////sync_PyrLKOpticalFlow_gpu.sparse(src_grey_gpu, dst_grey_gpu, prev_pts_flow_gpu, cur_pts_flow_gpu, status_gpu, &err_gpu); // OpenCV 2.4.x + sync_PyrLKOpticalFlow->calc(src_grey, dst_grey, prev_pts_flow, cur_pts_flow, status, err); // OpenCV 3.x + + dst_grey.copyTo(src_grey); + + std::vector result_bbox_vec; + + if (err.rows == cur_bbox_vec.size() && status.rows == cur_bbox_vec.size()) + { + for (size_t i = 0; i < cur_bbox_vec.size(); ++i) + { + cv::Point2f cur_key_pt = cur_pts_flow.at(0, i); + cv::Point2f prev_key_pt = prev_pts_flow.at(0, i); + + float moved_x = cur_key_pt.x - prev_key_pt.x; + float moved_y = cur_key_pt.y - prev_key_pt.y; + + if (abs(moved_x) < 100 && abs(moved_y) < 100 && good_bbox_vec_flags[i]) + if (err.at(0, i) < flow_error && status.at(0, i) != 0 && + ((float)cur_bbox_vec[i].x + moved_x) > 0 && ((float)cur_bbox_vec[i].y + moved_y) > 0) + { + cur_bbox_vec[i].x += moved_x + 0.5; + cur_bbox_vec[i].y += moved_y + 0.5; + result_bbox_vec.push_back(cur_bbox_vec[i]); + } + else good_bbox_vec_flags[i] = false; + else good_bbox_vec_flags[i] = false; + + //if(!check_error && !good_bbox_vec_flags[i]) result_bbox_vec.push_back(cur_bbox_vec[i]); + } + } + + prev_pts_flow = cur_pts_flow.clone(); + + return result_bbox_vec; + } + +}; +#else + +class Tracker_optflow {}; + +#endif // defined(TRACK_OPTFLOW) && defined(OPENCV) + + +#ifdef OPENCV + +static cv::Scalar obj_id_to_color(int obj_id) { + int const colors[6][3] = { { 1,0,1 },{ 0,0,1 },{ 0,1,1 },{ 0,1,0 },{ 1,1,0 },{ 1,0,0 } }; + int const offset = obj_id * 123457 % 6; + int const color_scale = 150 + (obj_id * 123457) % 100; + cv::Scalar color(colors[offset][0], colors[offset][1], colors[offset][2]); + color *= color_scale; + return color; +} + +class preview_boxes_t { + enum { frames_history = 30 }; // how long to keep the history saved + + struct preview_box_track_t { + unsigned int track_id, obj_id, last_showed_frames_ago; + bool current_detection; + bbox_t bbox; + cv::Mat mat_obj, mat_resized_obj; + preview_box_track_t() : track_id(0), obj_id(0), last_showed_frames_ago(frames_history), current_detection(false) {} + }; + std::vector preview_box_track_id; + size_t const preview_box_size, bottom_offset; + bool const one_off_detections; +public: + preview_boxes_t(size_t _preview_box_size = 100, size_t _bottom_offset = 100, bool _one_off_detections = false) : + preview_box_size(_preview_box_size), bottom_offset(_bottom_offset), one_off_detections(_one_off_detections) + {} + + void set(cv::Mat src_mat, std::vector result_vec) + { + size_t const count_preview_boxes = src_mat.cols / preview_box_size; + if (preview_box_track_id.size() != count_preview_boxes) preview_box_track_id.resize(count_preview_boxes); + + // increment frames history + for (auto &i : preview_box_track_id) + i.last_showed_frames_ago = std::min((unsigned)frames_history, i.last_showed_frames_ago + 1); + + // occupy empty boxes + for (auto &k : result_vec) { + bool found = false; + // find the same (track_id) + for (auto &i : preview_box_track_id) { + if (i.track_id == k.track_id) { + if (!one_off_detections) i.last_showed_frames_ago = 0; // for tracked objects + found = true; + break; + } + } + if (!found) { + // find empty box + for (auto &i : preview_box_track_id) { + if (i.last_showed_frames_ago == frames_history) { + if (!one_off_detections && k.frames_counter == 0) break; // don't show if obj isn't tracked yet + i.track_id = k.track_id; + i.obj_id = k.obj_id; + i.bbox = k; + i.last_showed_frames_ago = 0; + break; + } + } + } + } + + // draw preview box (from old or current frame) + for (size_t i = 0; i < preview_box_track_id.size(); ++i) + { + // get object image + cv::Mat dst = preview_box_track_id[i].mat_resized_obj; + preview_box_track_id[i].current_detection = false; + + for (auto &k : result_vec) { + if (preview_box_track_id[i].track_id == k.track_id) { + if (one_off_detections && preview_box_track_id[i].last_showed_frames_ago > 0) { + preview_box_track_id[i].last_showed_frames_ago = frames_history; break; + } + bbox_t b = k; + cv::Rect r(b.x, b.y, b.w, b.h); + cv::Rect img_rect(cv::Point2i(0, 0), src_mat.size()); + cv::Rect rect_roi = r & img_rect; + if (rect_roi.width > 1 || rect_roi.height > 1) { + cv::Mat roi = src_mat(rect_roi); + cv::resize(roi, dst, cv::Size(preview_box_size, preview_box_size), cv::INTER_NEAREST); + preview_box_track_id[i].mat_obj = roi.clone(); + preview_box_track_id[i].mat_resized_obj = dst.clone(); + preview_box_track_id[i].current_detection = true; + preview_box_track_id[i].bbox = k; + } + break; + } + } + } + } + + + void draw(cv::Mat draw_mat, bool show_small_boxes = false) + { + // draw preview box (from old or current frame) + for (size_t i = 0; i < preview_box_track_id.size(); ++i) + { + auto &prev_box = preview_box_track_id[i]; + + // draw object image + cv::Mat dst = prev_box.mat_resized_obj; + if (prev_box.last_showed_frames_ago < frames_history && + dst.size() == cv::Size(preview_box_size, preview_box_size)) + { + cv::Rect dst_rect_roi(cv::Point2i(i * preview_box_size, draw_mat.rows - bottom_offset), dst.size()); + cv::Mat dst_roi = draw_mat(dst_rect_roi); + dst.copyTo(dst_roi); + + cv::Scalar color = obj_id_to_color(prev_box.obj_id); + int thickness = (prev_box.current_detection) ? 5 : 1; + cv::rectangle(draw_mat, dst_rect_roi, color, thickness); + + unsigned int const track_id = prev_box.track_id; + std::string track_id_str = (track_id > 0) ? std::to_string(track_id) : ""; + putText(draw_mat, track_id_str, dst_rect_roi.tl() - cv::Point2i(-4, 5), cv::FONT_HERSHEY_COMPLEX_SMALL, 0.9, cv::Scalar(0, 0, 0), 2); + + std::string size_str = std::to_string(prev_box.bbox.w) + "x" + std::to_string(prev_box.bbox.h); + putText(draw_mat, size_str, dst_rect_roi.tl() + cv::Point2i(0, 12), cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar(0, 0, 0), 1); + + if (!one_off_detections && prev_box.current_detection) { + cv::line(draw_mat, dst_rect_roi.tl() + cv::Point2i(preview_box_size, 0), + cv::Point2i(prev_box.bbox.x, prev_box.bbox.y + prev_box.bbox.h), + color); + } + + if (one_off_detections && show_small_boxes) { + cv::Rect src_rect_roi(cv::Point2i(prev_box.bbox.x, prev_box.bbox.y), + cv::Size(prev_box.bbox.w, prev_box.bbox.h)); + unsigned int const color_history = (255 * prev_box.last_showed_frames_ago) / frames_history; + color = cv::Scalar(255 - 3 * color_history, 255 - 2 * color_history, 255 - 1 * color_history); + if (prev_box.mat_obj.size() == src_rect_roi.size()) { + prev_box.mat_obj.copyTo(draw_mat(src_rect_roi)); + } + cv::rectangle(draw_mat, src_rect_roi, color, thickness); + putText(draw_mat, track_id_str, src_rect_roi.tl() - cv::Point2i(0, 10), cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cv::Scalar(0, 0, 0), 1); + } + } + } + } +}; + + +class track_kalman_t +{ + int track_id_counter; + std::chrono::steady_clock::time_point global_last_time; + float dT; + +public: + int max_objects; // max objects for tracking + int min_frames; // min frames to consider an object as detected + const float max_dist; // max distance (in px) to track with the same ID + cv::Size img_size; // max value of x,y,w,h + + struct tst_t { + int track_id; + int state_id; + std::chrono::steady_clock::time_point last_time; + int detection_count; + tst_t() : track_id(-1), state_id(-1) {} + }; + std::vector track_id_state_id_time; + std::vector result_vec_pred; + + struct one_kalman_t; + std::vector kalman_vec; + + struct one_kalman_t + { + cv::KalmanFilter kf; + cv::Mat state; + cv::Mat meas; + int measSize, stateSize, contrSize; + + void set_delta_time(float dT) { + kf.transitionMatrix.at(2) = dT; + kf.transitionMatrix.at(9) = dT; + } + + void set(bbox_t box) + { + initialize_kalman(); + + kf.errorCovPre.at(0) = 1; // px + kf.errorCovPre.at(7) = 1; // px + kf.errorCovPre.at(14) = 1; + kf.errorCovPre.at(21) = 1; + kf.errorCovPre.at(28) = 1; // px + kf.errorCovPre.at(35) = 1; // px + + state.at(0) = box.x; + state.at(1) = box.y; + state.at(2) = 0; + state.at(3) = 0; + state.at(4) = box.w; + state.at(5) = box.h; + // <<<< Initialization + + kf.statePost = state; + } + + // Kalman.correct() calculates: statePost = statePre + gain * (z(k)-measurementMatrix*statePre); + // corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) + void correct(bbox_t box) { + meas.at(0) = box.x; + meas.at(1) = box.y; + meas.at(2) = box.w; + meas.at(3) = box.h; + + kf.correct(meas); + + bbox_t new_box = predict(); + if (new_box.w == 0 || new_box.h == 0) { + set(box); + //std::cerr << " force set(): track_id = " << box.track_id << + // ", x = " << box.x << ", y = " << box.y << ", w = " << box.w << ", h = " << box.h << std::endl; + } + } + + // Kalman.predict() calculates: statePre = TransitionMatrix * statePost; + // predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k) + bbox_t predict() { + bbox_t box; + state = kf.predict(); + + box.x = state.at(0); + box.y = state.at(1); + box.w = state.at(4); + box.h = state.at(5); + return box; + } + + void initialize_kalman() + { + kf = cv::KalmanFilter(stateSize, measSize, contrSize, CV_32F); + + // Transition State Matrix A + // Note: set dT at each processing step! + // [ 1 0 dT 0 0 0 ] + // [ 0 1 0 dT 0 0 ] + // [ 0 0 1 0 0 0 ] + // [ 0 0 0 1 0 0 ] + // [ 0 0 0 0 1 0 ] + // [ 0 0 0 0 0 1 ] + cv::setIdentity(kf.transitionMatrix); + + // Measure Matrix H + // [ 1 0 0 0 0 0 ] + // [ 0 1 0 0 0 0 ] + // [ 0 0 0 0 1 0 ] + // [ 0 0 0 0 0 1 ] + kf.measurementMatrix = cv::Mat::zeros(measSize, stateSize, CV_32F); + kf.measurementMatrix.at(0) = 1.0f; + kf.measurementMatrix.at(7) = 1.0f; + kf.measurementMatrix.at(16) = 1.0f; + kf.measurementMatrix.at(23) = 1.0f; + + // Process Noise Covariance Matrix Q - result smoother with lower values (1e-2) + // [ Ex 0 0 0 0 0 ] + // [ 0 Ey 0 0 0 0 ] + // [ 0 0 Ev_x 0 0 0 ] + // [ 0 0 0 Ev_y 0 0 ] + // [ 0 0 0 0 Ew 0 ] + // [ 0 0 0 0 0 Eh ] + //cv::setIdentity(kf.processNoiseCov, cv::Scalar(1e-3)); + kf.processNoiseCov.at(0) = 1e-2; + kf.processNoiseCov.at(7) = 1e-2; + kf.processNoiseCov.at(14) = 1e-2;// 5.0f; + kf.processNoiseCov.at(21) = 1e-2;// 5.0f; + kf.processNoiseCov.at(28) = 5e-3; + kf.processNoiseCov.at(35) = 5e-3; + + // Measures Noise Covariance Matrix R - result smoother with higher values (1e-1) + cv::setIdentity(kf.measurementNoiseCov, cv::Scalar(1e-1)); + + //cv::setIdentity(kf.errorCovPost, cv::Scalar::all(1e-2)); + // <<<< Kalman Filter + + set_delta_time(0); + } + + + one_kalman_t(int _stateSize = 6, int _measSize = 4, int _contrSize = 0) : + kf(_stateSize, _measSize, _contrSize, CV_32F), measSize(_measSize), stateSize(_stateSize), contrSize(_contrSize) + { + state = cv::Mat(stateSize, 1, CV_32F); // [x,y,v_x,v_y,w,h] + meas = cv::Mat(measSize, 1, CV_32F); // [z_x,z_y,z_w,z_h] + //cv::Mat procNoise(stateSize, 1, type) + // [E_x,E_y,E_v_x,E_v_y,E_w,E_h] + + initialize_kalman(); + } + }; + // ------------------------------------------ + + + + track_kalman_t(int _max_objects = 1000, int _min_frames = 3, float _max_dist = 40, cv::Size _img_size = cv::Size(10000, 10000)) : + track_id_counter(0), max_objects(_max_objects), min_frames(_min_frames), max_dist(_max_dist), img_size(_img_size) + { + kalman_vec.resize(max_objects); + track_id_state_id_time.resize(max_objects); + result_vec_pred.resize(max_objects); + } + + float calc_dt() { + dT = std::chrono::duration(std::chrono::steady_clock::now() - global_last_time).count(); + return dT; + } + + static float get_distance(float src_x, float src_y, float dst_x, float dst_y) { + return sqrtf((src_x - dst_x)*(src_x - dst_x) + (src_y - dst_y)*(src_y - dst_y)); + } + + void clear_old_states() { + // clear old bboxes + for (size_t state_id = 0; state_id < track_id_state_id_time.size(); ++state_id) + { + float time_sec = std::chrono::duration(std::chrono::steady_clock::now() - track_id_state_id_time[state_id].last_time).count(); + float time_wait = 0.5; // 0.5 second + if (track_id_state_id_time[state_id].track_id > -1) + { + if ((result_vec_pred[state_id].x > img_size.width) || + (result_vec_pred[state_id].y > img_size.height)) + { + track_id_state_id_time[state_id].track_id = -1; + } + + if (time_sec >= time_wait || track_id_state_id_time[state_id].detection_count < 0) { + //std::cerr << " remove track_id = " << track_id_state_id_time[state_id].track_id << ", state_id = " << state_id << std::endl; + track_id_state_id_time[state_id].track_id = -1; // remove bbox + } + } + } + } + + tst_t get_state_id(bbox_t find_box, std::vector &busy_vec) + { + tst_t tst; + tst.state_id = -1; + + float min_dist = std::numeric_limits::max(); + + for (size_t i = 0; i < max_objects; ++i) + { + if (track_id_state_id_time[i].track_id > -1 && result_vec_pred[i].obj_id == find_box.obj_id && busy_vec[i] == false) + { + bbox_t pred_box = result_vec_pred[i]; + + float dist = get_distance(pred_box.x, pred_box.y, find_box.x, find_box.y); + + float movement_dist = std::max(max_dist, static_cast(std::max(pred_box.w, pred_box.h)) ); + + if ((dist < movement_dist) && (dist < min_dist)) { + min_dist = dist; + tst.state_id = i; + } + } + } + + if (tst.state_id > -1) { + track_id_state_id_time[tst.state_id].last_time = std::chrono::steady_clock::now(); + track_id_state_id_time[tst.state_id].detection_count = std::max(track_id_state_id_time[tst.state_id].detection_count + 2, 10); + tst = track_id_state_id_time[tst.state_id]; + busy_vec[tst.state_id] = true; + } + else { + //std::cerr << " Didn't find: obj_id = " << find_box.obj_id << ", x = " << find_box.x << ", y = " << find_box.y << + // ", track_id_counter = " << track_id_counter << std::endl; + } + + return tst; + } + + tst_t new_state_id(std::vector &busy_vec) + { + tst_t tst; + // find empty cell to add new track_id + auto it = std::find_if(track_id_state_id_time.begin(), track_id_state_id_time.end(), [&](tst_t &v) { return v.track_id == -1; }); + if (it != track_id_state_id_time.end()) { + it->state_id = it - track_id_state_id_time.begin(); + //it->track_id = track_id_counter++; + it->track_id = 0; + it->last_time = std::chrono::steady_clock::now(); + it->detection_count = 1; + tst = *it; + busy_vec[it->state_id] = true; + } + + return tst; + } + + std::vector find_state_ids(std::vector result_vec) + { + std::vector tst_vec(result_vec.size()); + + std::vector busy_vec(max_objects, false); + + for (size_t i = 0; i < result_vec.size(); ++i) + { + tst_t tst = get_state_id(result_vec[i], busy_vec); + int state_id = tst.state_id; + int track_id = tst.track_id; + + // if new state_id + if (state_id < 0) { + tst = new_state_id(busy_vec); + state_id = tst.state_id; + track_id = tst.track_id; + if (state_id > -1) { + kalman_vec[state_id].set(result_vec[i]); + //std::cerr << " post: "; + } + } + + //std::cerr << " track_id = " << track_id << ", state_id = " << state_id << + // ", x = " << result_vec[i].x << ", det_count = " << tst.detection_count << std::endl; + + if (state_id > -1) { + tst_vec[i] = tst; + result_vec_pred[state_id] = result_vec[i]; + result_vec_pred[state_id].track_id = track_id; + } + } + + return tst_vec; + } + + std::vector predict() + { + clear_old_states(); + std::vector result_vec; + + for (size_t i = 0; i < max_objects; ++i) + { + tst_t tst = track_id_state_id_time[i]; + if (tst.track_id > -1) { + bbox_t box = kalman_vec[i].predict(); + + result_vec_pred[i].x = box.x; + result_vec_pred[i].y = box.y; + result_vec_pred[i].w = box.w; + result_vec_pred[i].h = box.h; + + if (tst.detection_count >= min_frames) + { + if (track_id_state_id_time[i].track_id == 0) { + track_id_state_id_time[i].track_id = ++track_id_counter; + result_vec_pred[i].track_id = track_id_counter; + } + + result_vec.push_back(result_vec_pred[i]); + } + } + } + //std::cerr << " result_vec.size() = " << result_vec.size() << std::endl; + + //global_last_time = std::chrono::steady_clock::now(); + + return result_vec; + } + + + std::vector correct(std::vector result_vec) + { + calc_dt(); + clear_old_states(); + + for (size_t i = 0; i < max_objects; ++i) + track_id_state_id_time[i].detection_count--; + + std::vector tst_vec = find_state_ids(result_vec); + + for (size_t i = 0; i < tst_vec.size(); ++i) { + tst_t tst = tst_vec[i]; + int state_id = tst.state_id; + if (state_id > -1) + { + kalman_vec[state_id].set_delta_time(dT); + kalman_vec[state_id].correct(result_vec_pred[state_id]); + } + } + + result_vec = predict(); + + global_last_time = std::chrono::steady_clock::now(); + + return result_vec; + } + +}; +// ---------------------------------------------- +#endif // OPENCV + +#endif // __cplusplus + +#endif // YOLO_V2_CLASS_HPP diff --git a/lib/yolov4/libdarknet.so b/lib/yolov4/libdarknet.so new file mode 100755 index 0000000..ee63f66 Binary files /dev/null and b/lib/yolov4/libdarknet.so differ