Skip to content

Commit 8b75715

Browse files
authored
Merge pull request #4 from llDev-Rootll/development
Merging Phase 1 development to branch : master
2 parents b76edda + 0e100f5 commit 8b75715

File tree

364 files changed

+156182
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+156182
-8
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# VS Code files
2+
*.VC.db*
3+
4+
.vscode/
5+
# OS X files
6+
.DS_Store
7+
8+
# Build artifacts
9+
build/
10+
*.weights
11+
12+
# Python
13+
*.pyc

.travis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# We need a decent ubuntu dist
2+
sudo: required
3+
dist: xenial
4+
5+
# Modern cpp settings from
6+
# http://genbattle.bitbucket.org/blog/2016/01/17/c++-travis-ci/
7+
language: cpp
8+
matrix:
9+
include:
10+
- os: linux
11+
compiler: gcc
12+
addons:
13+
apt:
14+
sources:
15+
- ubuntu-toolchain-r-test
16+
- george-edison55-precise-backports
17+
packages:
18+
- g++-5
19+
- cmake
20+
- cmake-data
21+
env: COMPILER=g++-5
22+
23+
before_install:
24+
- pip install --user cpp-coveralls
25+
- sudo chmod a+x scripts/getModels.sh
26+
- ./scripts/getModels.sh
27+
install:
28+
- sudo chmod a+x scripts/install_dependencies.sh
29+
- ./scripts/install_dependencies.sh
30+
script:
31+
- export CXX=$COMPILER;
32+
- mkdir build
33+
- cd build
34+
- cmake -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug ../
35+
- make
36+
- make code_coverage
37+
- test/cpp-test
38+
39+
after_success:
40+
- coveralls --root .. -E ".*external.*" -E ".*CMakeFiles.*" -E ".*test/.*.cpp.*"
41+
42+
notifications:
43+
email: false

.ycm_extra_conf.py

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Generated by YCM Generator at 2016-10-18 10:13:21.653665
2+
3+
# This file is NOT licensed under the GPLv3, which is the license for the rest
4+
# of YouCompleteMe.
5+
#
6+
# Here's the license text for this file:
7+
#
8+
# This is free and unencumbered software released into the public domain.
9+
#
10+
# Anyone is free to copy, modify, publish, use, compile, sell, or
11+
# distribute this software, either in source code form or as a compiled
12+
# binary, for any purpose, commercial or non-commercial, and by any
13+
# means.
14+
#
15+
# In jurisdictions that recognize copyright laws, the author or authors
16+
# of this software dedicate any and all copyright interest in the
17+
# software to the public domain. We make this dedication for the benefit
18+
# of the public at large and to the detriment of our heirs and
19+
# successors. We intend this dedication to be an overt act of
20+
# relinquishment in perpetuity of all present and future rights to this
21+
# software under copyright law.
22+
#
23+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
26+
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
27+
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
28+
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
29+
# OTHER DEALINGS IN THE SOFTWARE.
30+
#
31+
# For more information, please refer to <http://unlicense.org/>
32+
33+
import os
34+
import ycm_core
35+
36+
flags = [
37+
'-x',
38+
'c++',
39+
'-DGTEST_HAS_PTHREAD=1',
40+
'-I/Users/david/code/scratch/cpp/include',
41+
'-I/Users/david/code/scratch/cpp/test/../vendor/googletest/googletest/include',
42+
'-I/Users/david/code/scratch/cpp/vendor/boost',
43+
'-I/Users/david/code/scratch/cpp/vendor/googletest/googletest',
44+
'-I/Users/david/code/scratch/cpp/vendor/googletest/googletest/include',
45+
'-Wall',
46+
'-Wextra',
47+
'-Wpedantic',
48+
'-std=c++14',
49+
]
50+
51+
52+
# Set this to the absolute path to the folder (NOT the file!) containing the
53+
# compile_commands.json file to use that instead of 'flags'. See here for
54+
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
55+
#
56+
# You can get CMake to generate this file for you by adding:
57+
# set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
58+
# to your CMakeLists.txt file.
59+
#
60+
# Most projects will NOT need to set this to anything; you can just change the
61+
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
62+
compilation_database_folder = ''
63+
64+
if os.path.exists( compilation_database_folder ):
65+
database = ycm_core.CompilationDatabase( compilation_database_folder )
66+
else:
67+
database = None
68+
69+
SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
70+
71+
def DirectoryOfThisScript():
72+
return os.path.dirname( os.path.abspath( __file__ ) )
73+
74+
75+
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
76+
if not working_directory:
77+
return list( flags )
78+
new_flags = []
79+
make_next_absolute = False
80+
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
81+
for flag in flags:
82+
new_flag = flag
83+
84+
if make_next_absolute:
85+
make_next_absolute = False
86+
if not flag.startswith( '/' ):
87+
new_flag = os.path.join( working_directory, flag )
88+
89+
for path_flag in path_flags:
90+
if flag == path_flag:
91+
make_next_absolute = True
92+
break
93+
94+
if flag.startswith( path_flag ):
95+
path = flag[ len( path_flag ): ]
96+
new_flag = path_flag + os.path.join( working_directory, path )
97+
break
98+
99+
if new_flag:
100+
new_flags.append( new_flag )
101+
return new_flags
102+
103+
104+
def IsHeaderFile( filename ):
105+
extension = os.path.splitext( filename )[ 1 ]
106+
return extension in [ '.H', '.h', '.hxx', '.hpp', '.hh' ]
107+
108+
109+
def GetCompilationInfoForFile( filename ):
110+
# The compilation_commands.json file generated by CMake does not have entries
111+
# for header files. So we do our best by asking the db for flags for a
112+
# corresponding source file, if any. If one exists, the flags for that file
113+
# should be good enough.
114+
if IsHeaderFile( filename ):
115+
basename = os.path.splitext( filename )[ 0 ]
116+
for extension in SOURCE_EXTENSIONS:
117+
replacement_file = basename + extension
118+
if os.path.exists( replacement_file ):
119+
compilation_info = database.GetCompilationInfoForFile(
120+
replacement_file )
121+
if compilation_info.compiler_flags_:
122+
return compilation_info
123+
return None
124+
return database.GetCompilationInfoForFile( filename )
125+
126+
127+
def FlagsForFile( filename, **kwargs ):
128+
if database:
129+
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
130+
# python list, but a "list-like" StringVec object
131+
compilation_info = GetCompilationInfoForFile( filename )
132+
if not compilation_info:
133+
return None
134+
135+
final_flags = MakeRelativePathsInFlagsAbsolute(
136+
compilation_info.compiler_flags_,
137+
compilation_info.compiler_working_dir_ )
138+
139+
else:
140+
relative_to = DirectoryOfThisScript()
141+
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
142+
143+
return {
144+
'flags': final_flags,
145+
'do_cache': True
146+
}
147+

Activity_Diagram.pdf

-27.1 KB
Binary file not shown.

CMakeLists.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
cmake_minimum_required(VERSION 3.2.1)
2+
project(scratch)
3+
4+
5+
# Add project cmake modules to path.
6+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
7+
#set(OpenCV_DIR ${PROJECT_SOURCE_DIR}/cmake/)
8+
#set path for openCV and Eigen3
9+
find_package(OpenCV REQUIRED)
10+
find_package(Eigen3 REQUIRED)
11+
#Add openCV
12+
include_directories(${OpenCV_INCLUDE_DIRS})
13+
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
14+
15+
# We probably don't want this to run on every build.
16+
option(COVERAGE "Generate Coverage Data" OFF)
17+
18+
if (COVERAGE)
19+
include(CodeCoverage)
20+
set(LCOV_REMOVE_EXTRA "'vendor/*'")
21+
setup_target_for_coverage(code_coverage test/cpp-test coverage)
22+
set(COVERAGE_SRCS app/main.cpp test/include/test_Robot.h test/include/test_HumanDetector.h test/src/test_Robot.cpp test/src/test_HumanDetector.cpp)
23+
24+
SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
25+
SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
26+
SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
27+
else()
28+
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -g")
29+
endif()
30+
31+
include(CMakeToolsHelpers OPTIONAL)
32+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
33+
set(CMAKE_CXX_STANDARD 14)
34+
35+
add_subdirectory(app)
36+
add_subdirectory(src)
37+
add_subdirectory(test)
38+
add_subdirectory(test/src)
39+
add_subdirectory(vendor/googletest/googletest)

Quad_Chart.pdf

-111 KB
Binary file not shown.

README.md

Lines changed: 71 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,82 @@
11

2-
32
# Human_Detection_Tracking-CPP
4-
[![Build Status](https://app.travis-ci.com/llDev-Rootll/Human_Detection_Tracking-CPP.svg?branch=master)](https://app.travis-ci.com/llDev-Rootll/Human_Detection_Tracking-CPP)
5-
[![Coverage Status](https://coveralls.io/repos/github/llDev-Rootll/Human_Detection_Tracking-CPP/badge.svg?branch=master)](https://coveralls.io/github/llDev-Rootll/Human_Detection_Tracking-CPP?branch=master)
3+
[![Build Status](https://app.travis-ci.com/aditiramadwar/Human_Detection_Tracking-CPP.svg?branch=Phase_1)](https://app.travis-ci.com/aditiramadwar/Human_Detection_Tracking-CPP)
4+
[![Coverage Status](https://coveralls.io/repos/github/aditiramadwar/Human_Detection_Tracking-CPP/badge.svg?branch=Phase_1)](https://coveralls.io/github/aditiramadwar/Human_Detection_Tracking-CPP?branch=Phase_1)
65
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
76

87
A C++ module to detect and track humans which outputs location information directly in a robot's reference frame.
98

9+
## Authors
10+
11+
- Arunava Basu (Navigator)
12+
- Aditi Ramadwar (Driver)
13+
1014
## Introduction
11-
This repository contains a robust human obstacle detector and tracker using a monocular camera, directly usable in a robot’s reference frame.
15+
Human detection or person detection is the computer vision task of the localization and classification of human being(s) in an image. This is a key part in robotic applications for various reasons such as safety, obstacle avoidance, collaborative robotics, etc.
16+
17+
We aim to design and deliver a robust robust human obstacle detector and tracker using a monocular camera, directly usable in a robot’s reference frame according to the requirement specifications provided to us by ACME robotics's RnD division for integration into a future product.
18+
19+
Our system is built using C++ and will employ the robust YOLOv3 neural network model trained on the COCO dataset for human detection and tracking as it is one of the most accurate real-time object detection algorithms. A one time calibration is performed to calculate certain calibration metrics for the transformation of location info into the camera frame. An image from a monocular camera is pre-processed and passed to the model which outputs the location info in the image frame. It is then converted to the camera frame by using the calibration constants and then transformed into the robot's frame.
20+
21+
## Project Collaterals
22+
The Agile Iterative Process will be used for the development of this system consisting of two sprints.
23+
24+
The project proposal can be found [here](https://github.com/llDev-Rootll/Human_Detection_Tracking-CPP/blob/development/assets/Human%20Detector%20%26%20Tracker%20-%20Proposal.pdf).
25+
26+
The quad chart can be found [here](https://github.com/llDev-Rootll/Human_Detection_Tracking-CPP/blob/development/assets/Quad_Chart.pdf).
27+
28+
The overall backlog table and the tables for each sprints can be found [here](https://docs.google.com/spreadsheets/d/1tjJKUd9B4bBSYAHnrwuMjWNl_lUBmqeB6lw7iTNKZSg/edit?usp=sharing).
29+
30+
## Requirements
31+
| Name | Version |
32+
| :--- | :---: |
33+
| C++ | 14++ |
34+
| CMake | min 3.2.1 |
35+
36+
Continuous integration is tracked by using Travis CI and code coverage is tracked using coveralls.
37+
## Dependencies
38+
39+
| Name | Version | License |
40+
| :--- | :---: | ---: |
41+
| OpenCV | 4.5.1 | [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) |
42+
| Eigen | 3.X.X | [MPL2](https://www.mozilla.org/en-US/MPL/2.0/FAQ/) |
43+
44+
Run this command in the root directory to install the dependencies :
45+
```
46+
chmod a+x scripts/install_dependencies.sh
47+
./scripts/install_dependencies.sh
48+
```
49+
50+
## System Architecture
51+
The following shows the activity diagram for our proposed schema :
52+
<img alt="activity" src="assets/activity.png" width="75%" />
53+
54+
*Fig 1 : Activity Diagram*
55+
56+
The corresponding class diagram can be found [here](https://github.com/llDev-Rootll/Human_Detection_Tracking-CPP/blob/development/UML/revised/Revised_Class_Diagram.pdf).
57+
## Testing
58+
Unit Testing will be used to test each submodule and ensure complete code coverage. For this Google Gtest will be leveraged and identical test classes and methods will be created with minimal modification in order to facilitate testing.
59+
60+
Additionally, a small test subset of the COCO test data will be used to validate model accuracy.
1261

13-
The initial design is as follows :
62+
## Building without code coverage
63+
Execute these commands in the root folder :
64+
```
65+
chmod a+x scripts/build_without_coverage.sh
66+
./scripts/build_without_coverage.sh
67+
```
68+
## Building with code coverage
1469

15-
<img alt="design" src="assets/design.gif" width="75%" />
70+
Execute these commands in the root folder :
71+
```
72+
sudo apt-get install lcov
73+
chmod a+x scripts/build_with_coverage.sh
74+
./scripts/build_with_coverage.sh
75+
```
76+
## Phase 1
1677

17-
*Fig 1 : High Level Arhitecture Design*
78+
- Defined Robot, HumanDetector and test classes according to the UML diagrams.
79+
- Implemented all Robot and HumanDetector methods except for transformToRobotFrame method.
80+
- Definition and implementation of test cases are planned for Phase 2.
81+
Please refer to the backlog table, [here](https://docs.google.com/spreadsheets/d/1tjJKUd9B4bBSYAHnrwuMjWNl_lUBmqeB6lw7iTNKZSg/edit?usp=sharing), for an exhaustive list tasks completed in Phase 1.
1882

19-
## Currently under development in the "development" branch [here](https://github.com/llDev-Rootll/Human_Detection_Tracking-CPP/tree/development)

UML/initial/Activity_Diagram.pdf

74.1 KB
Binary file not shown.

UML/initial/Class_Diagram.pdf

19.1 KB
Binary file not shown.
50.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)