Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2a689a8
initial commit
fpertl May 11, 2020
20a594f
fixed defaults
fpertl May 11, 2020
fc23645
added more info on models used
fpertl May 12, 2020
24d1432
removed dead comments
fpertl May 12, 2020
446ed38
changed license to MIXED
fpertl May 12, 2020
5ea2522
fix formatting
fpertl May 12, 2020
6bfe8b0
fix list
fpertl May 12, 2020
08870f3
some rewording
fpertl May 12, 2020
5c872b8
format references
fpertl May 12, 2020
b4e9e25
formatting
fpertl May 12, 2020
407c4fd
typo
fpertl May 12, 2020
eb9295e
fixed NRL link and typos
fpertl May 13, 2020
fe264cd
noted: unassigned detections become new tracks
fpertl May 13, 2020
408c301
set build to release with symbols
fpertl May 20, 2020
75a1cb8
fixed typos, comments and whitespace
fpertl May 20, 2020
ac68887
more typo and whitspace cleanup
fpertl May 21, 2020
7180cb2
commented out groudtruth track writing
fpertl May 27, 2020
d54b0a3
Updates to dockerfile, descriptor, and CMakeLists.txt. Fixed docker b…
May 29, 2020
27d0524
fixed SSD capitalization
fpertl May 29, 2020
d5a493d
Merge branch 'ssd-face' of github.com:openmpf/openmpf-components into…
fpertl May 29, 2020
0e1492f
Updated dlib version from 18.18 to 19.19 in Dockerfile and CMakeLists…
hhuangMITRE May 29, 2020
d80da10
Merge branch 'ssd-face' of https://github.com/openmpf/openmpf-compone…
hhuangMITRE May 29, 2020
6ed350b
Minor CMakeLists.txt cleanup.
hhuangMITRE May 29, 2020
d2ce59c
parameterized opencv version
fpertl Jun 1, 2020
bbd9d57
hold on to frame for MOSSE tracker
fpertl Jun 3, 2020
832b157
fix early stop of tracker, release on detection
fpertl Jun 3, 2020
13b588c
Updating cpp/CMakeLists.txt to include OcvSsdFaceDetection component.
hhuangMITRE Jun 4, 2020
eb93ff3
Revert "Updating cpp/CMakeLists.txt to include OcvSsdFaceDetection co…
hhuangMITRE Jun 8, 2020
691520c
added ocvSsdFaceDetection with Kalman filtering
fpertl Jun 12, 2020
6215c77
use feature not iou threshold
fpertl Jun 12, 2020
db7293a
Merge branch 'ssd-face' of github.com:openmpf/openmpf-components into…
fpertl Jun 12, 2020
fcc20d8
reworked CUDA stuff and kalman noise cov inputs
fpertl Jun 17, 2020
4f036cb
kalman filter refactoring
fpertl Jun 28, 2020
dde5f9a
api change and ocv version agnostic
fpertl Jun 28, 2020
48c6c23
merged kalman filter version for ocv4
fpertl Jun 28, 2020
e509854
revise comment and descriptions
fpertl Jun 29, 2020
0852f0c
fixed typo
fpertl Jul 7, 2020
99cac65
multi rotation inferencing and detection angle
fpertl Jul 24, 2020
44f937f
disable diagnostic images
fpertl Jul 24, 2020
a770755
fix CUDA device reset and max_cost_assignment
fpertl Aug 19, 2020
cc1be06
allow only one assignement per track per frame
fpertl Aug 24, 2020
a256c14
fix frame index offset
fpertl Aug 24, 2020
98d9bcd
use videocap to get frame index
fpertl Aug 24, 2020
b80f846
fix potential issue in dlib::max_assignemnt _cost
fpertl Aug 25, 2020
02b1177
fix kalman filter, minor cleanup
fpertl Sep 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions cpp/OcvSsdFaceDetection/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2020 The MITRE Corporation. All Rights Reserved. #
#############################################################################

#############################################################################
# Copyright 2020 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################
from openmpf/openmpf_cpp_component_build

COPY fsroot/ /

RUN yum install --assumeyes \
git gdb which mlocate \
jasper-devel openexr-devel libwebp-devel \
bzip2 libtiff-devel libdc1394-devel tbb-devel libv4l-devel \
gstreamer-plugins-base-devel ffmpeg-devel \
gcc-gfortran gcc-c++ openblas openblas-devel lapack lapack-devel

RUN echo '/usr/local/lib64' > /etc/ld.so.conf.d/usr_local_lib64.conf; \
ldconfig;

RUN mkdir -p /tmp/opencv; \
cd /tmp/opencv; \
[[ -e opencv-3.4.7 ]] || curl --location 'https://github.com/opencv/opencv/archive/3.4.7.tar.gz' | tar --extract --gzip; \
[[ -e opencv_contrib-3.4.7 ]] || curl --location 'https://github.com/opencv/opencv_contrib/archive/3.4.7.tar.gz' | tar --extract --gzip; \
cd opencv-3.4.7; \
mkdir build; \
cd build; \
cmake3 -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.7/modules \
-DCMAKE_INSTALL_PREFIX:PATH="/opt/opencv-3.4.7" \
-DBUILD_DOCS:BOOL="0" \
-DINSTALL_PYTHON_EXAMPLES:BOOL="0" \
-DINSTALL_C_EXAMPLES:BOOL="0" \
-DWITH_IPP:BOOL="0" \
-DWITH_FFMPEG:BOOL="1" \
-DWITH_TIFF:BOOL="1" \
-DWITH_JPEG:BOOL="1" \
-DWITH_WEBP:BOOL="1" \
-DWITH_1394:BOOL="1" \
-DWITH_LIBV4L:BOOL="1" ..; \
make --jobs "$(nproc)" install; \
ln --symbolic /opt/opencv-3.4.7/include/opencv2 /usr/local/include/opencv2; \
ln --symbolic /opt/opencv-3.4.7/include/opencv /usr/local/include/opencv; \
rm --recursive /tmp/opencv; \
ldconfig;

RUN mkdir -p /tmp/dlib; \
cd /tmp/dlib; \
[[ -e dlib-19.19 ]] || curl --location 'http://dlib.net/files/dlib-19.19.tar.bz2' | tar --extract --bzip2; \
cd dlib-19.19; \
mkdir build; \
cd build; \
#cmake3 -DCMAKE_INSTALL_PREFIX:PATH="/opt/dlib" ..; \
cmake3 -DBUILD_SHARED_LIBS:BOOL="1" ..; \
cmake3 --build . --config Release; \
make --jobs "$(nproc)" install; \
ldconfig;

RUN ln -s /usr/bin/cmake3 /usr/bin/cmake;

LABEL org.label-schema.license="Mixed" \
org.label-schema.name="OpenMPF OpenCV SSD Face Detection Dev" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://openmpf.github.io" \
org.label-schema.vcs-url="https://github.com/openmpf/openmpf-components" \
org.label-schema.vendor="MITRE"
32 changes: 32 additions & 0 deletions cpp/OcvSsdFaceDetection/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "OcvSsdFaceDetection",

// The order of the files is important since later files override previous ones
"dockerComposeFile": ["./docker-compose.yml"],

"service": "OcvSsdFaceDetection",
"workspaceFolder": "/home/mpf/openmpf-components/cpp/OcvSsdFaceDetection",
"shutdownAction": "stopCompose",
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"sleistner.vscode-fileutils",
"bierner.markdown-preview-github-styles",
"ryanmcalister.unotes",
"redhat.vscode-yaml",
"matepek.vscode-catch2-test-adapter"
],
"settings":{
"gtest-adapter.debugConfig": "Debug",
"cmake.ctestPath": "/usr/bin/ctest3",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"${workspaceRoot}/build": true,
"${workspaceRoot}/.devcontainer/fsroot": true
}
}
}
31 changes: 31 additions & 0 deletions cpp/OcvSsdFaceDetection/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: '2.2'

services:
OcvSsdFaceDetection:
cpuset: "0,1,2,3"
#cpus: "1.0"
image: openmpf/openmpf_cpp_component_dev
build:
context: .
dockerfile: Dockerfile
environment:
MPF_LOG_PATH: .
THIS_MPF_NODE: .
volumes:
# Mounts the project folder to '/workspace'. While this file is in .devcontainer,
# mounts are relative to the first file in the list, which is a level up.
- ../../..:/home/mpf/openmpf-components:cached

# [Optional] Required for ptrace-based debuggers like C++, Go, and Rust
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

networks:
default:
external:
name: localdev
23 changes: 23 additions & 0 deletions cpp/OcvSsdFaceDetection/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"configurations": [
{
"name": "Linux",
"defines": [],
"compilerPath": "/usr/bin/gcc",
"intelliSenseMode": "gcc-x64",
"configurationProvider": "vector-of-bool.cmake-tools",
"includePath": [
"${workspaceFolder}",
"/usr/include/**",
"/opt/opencv-3.4.7/include/**",
"/home/mpf/mpf-sdk-install/include/**"
],
"browse": {
"path": ["${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
}
],
"version": 4
}
33 changes: 33 additions & 0 deletions cpp/OcvSsdFaceDetection/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build//test/OcvSsdFaceDetectionTest",
// "args": ["./test/data/test_imgs/meds_faces_image.png"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/test",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Enable all-exceptions",
"text": "catch throw",
"ignoreFailures": true
}
]
}

]
}
26 changes: 26 additions & 0 deletions cpp/OcvSsdFaceDetection/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"cmake.ctestPath": "/usr/bin/ctest3",
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"files.exclude": {
"**/.git":true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"${workspaceRoot}/build": true,
"${workspaceRoot}/.devcontainer/fsroot": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"/usr/include/**": true,
"/opt/opencv-3.4.7/include/**": true,
"/home/mpf/mpf-sdk-install/include/**": true,
"${workspaceRoot}/build": true,
"${workspaceRoot}/.devcontainer/fsroot": true
},
"git.ignoreLimitWarning": true
}
19 changes: 19 additions & 0 deletions cpp/OcvSsdFaceDetection/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"tasks": [
{
"type": "shell",
"label": "gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
}
}
],
"version": "2.0.0"
}
94 changes: 94 additions & 0 deletions cpp/OcvSsdFaceDetection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under contract, and is subject to the Rights in Data-General Clause #
# 52.227-14, Alt. IV (DEC 2007). #
# #
# Copyright 2020 The MITRE Corporation. All Rights Reserved. #
#############################################################################

#############################################################################
# Copyright 2020 The MITRE Corporation #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#############################################################################


cmake_minimum_required(VERSION 3.6)
project(ocv-ssd-face-detection)

set(CMAKE_CXX_STANDARD 11)

set(CMAKE_BUILD_TYPE RelWithDebInfo) # build release version with debug symbols
#set(CMAKE_BUILD_TYPE Debug) # build debug version

add_definitions(-Wfatal-errors)
include(../ComponentSetup.cmake)

# Specify dlib source directory here.
# Otherwise, disable the following three lines if using find_package(dlib) instead.
set(DLIB_DIR /apps/source/dlib-sources/dlib-18.18/dlib)
include(${DLIB_DIR}/cmake)
set_property(TARGET dlib PROPERTY POSITION_INDEPENDENT_CODE ON)

# Uncomment if not specifying dlib source directory.
# Warning: may not work with dlib release installation.
# find_package(dlib REQUIRED)

find_package(OpenCV 3.4.7 EXACT
REQUIRED PATHS /opt/opencv-3.4.7
COMPONENTS
opencv_dnn
opencv_video
opencv_face
opencv_tracking
)

find_package(mpfComponentInterface REQUIRED)
find_package(mpfDetectionComponentApi REQUIRED)
find_package(mpfComponentUtils REQUIRED)
find_package(Qt4 REQUIRED)

find_package(GTest)
if (${GTEST_FOUND})
message("-- found GTest, configuring tests")
enable_testing()
include(Dart)
endif()

set(OCV_SSD_FACE_DETECTION_SOURCE_FILES
JobConfig.cpp
DetectionLocation.cpp
OcvSsdFaceDetection.cpp)

add_library(mpfOcvSsdFaceDetection SHARED ${OCV_SSD_FACE_DETECTION_SOURCE_FILES})
target_link_libraries(mpfOcvSsdFaceDetection
mpfComponentInterface
mpfDetectionComponentApi
mpfComponentUtils
${OpenCV_LIBS}
dlib)

configure_mpf_component(OcvSsdFaceDetection TARGETS mpfOcvSsdFaceDetection)

add_subdirectory(test)

add_executable( sample_ocv_ssd_face_detector sample_ocv_ssd_face_detector.cpp)
target_link_libraries(sample_ocv_ssd_face_detector mpfOcvSsdFaceDetection)

# update configs if they change
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
plugin-files/config/mpfOcvSsdFaceDetection.ini
plugin-files/config/Log4cxxConfig.xml
plugin-files/descriptor/descriptor.json)
Loading