Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from vinay0410/master
Browse files Browse the repository at this point in the history
[ GSOC 2018 ] AppImages for ROS and ICE, fixed ROS OpenCV conflict, Evaluator also generates a CSV file contatining results
  • Loading branch information
chanfr committed Aug 14, 2018
2 parents e8bd920 + f00bf29 commit f72ce01
Show file tree
Hide file tree
Showing 45 changed files with 500 additions and 268 deletions.
32 changes: 18 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
language: cpp

# blacklist
branches:
except:
- master

# whitelist
branches:
only:
- travis-test

os:
- linux
- osx
Expand All @@ -25,6 +15,12 @@ cache:
pip: true
directories:
- $HOME/opencv/
- $HOME/darknet/

matrix:
include:
- env: TO_TEST=WITH_ROS_AND_ICE


before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
Expand All @@ -37,23 +33,31 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install -y rapidjson-dev ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install -y libboost-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install -y libgoogle-glog-dev libyaml-cpp-dev qt5-default libqt5svg5-dev libqt5opengl5-dev ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 5E6DA83306132997 ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo apt-add-repository "deb http://zeroc.com/download/Ice/3.6/ubuntu16.04 stable main" ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo apt update ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then sudo apt install ros-kinetic-roscpp ros-kinetic-cv-bridge ros-kinetic-image-transport zeroc-ice-all-runtime zeroc-ice-all-dev ; fi
- if [[ ( "$TRAVIS_OS_NAME" == "linux" ) && ( "$TO_TEST" == "WITH_ROS_AND_ICE" ) ]]; then source /opt/ros/kinetic/setup.bash ; fi
- sudo pip install numpy
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./install_opencv.sh ; fi
- ./install_darknet.sh

before_script:
- cd DeepLearningSuite
- mkdir build
- cd build
- cmake ..

script: make -j4
script: make -j2


after_success:
- bash ../package.sh
- ls -lh out/* # Assuming you have some files in out/ that you would like to upload
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis_wait bash ../package.sh ; fi # To run the script in the same shell so as to setup environment variables
- ls -lh out/* # Assuming you have some files in out/ that you would like to upload
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh out/*
- travis_wait bash upload.sh out/*


branches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

#include <FrameworkEvaluator/DetectionsEvaluator.h>
#include <FrameworkEvaluator/StatsWriter.h>
#include "Evaluator.h"
#include "SamplerGenerationHandler.h"

Expand Down Expand Up @@ -47,4 +48,14 @@ SampleGeneratorHandler::Evaluator::process(QListView *datasetListGT, QListView *
evaluator->evaluate(isIouTypeBbox);
evaluator->accumulateResults();



std::string mywriterFile("Evaluation Results.csv" );

StatsWriter writer(readerGT->getReader(), mywriterFile);

writer.writeInferencerResults("Detection Dataset", evaluator);

writer.saveFile();

}
3 changes: 2 additions & 1 deletion DeepLearningSuite/DatasetEvaluationApp/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "mainwindow.h"
#include <QApplication>
#include <Utils/SampleGenerationApp.h>

#include <QStyleFactory>

class MyApp:public SampleGenerationApp{
public:
Expand All @@ -17,6 +17,7 @@ class MyApp:public SampleGenerationApp{
MainWindow w(this);
w.show();


a.exec();

};
Expand Down
12 changes: 8 additions & 4 deletions DeepLearningSuite/DatasetEvaluationApp/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,13 @@ void MainWindow::setupTabsInformation() {
void MainWindow::handleSelectOutputFolderButton() {
QFileDialog *fd = new QFileDialog;
QTreeView *tree = fd->findChild <QTreeView*>();
#ifndef __APPLE__
tree->setRootIsDecorated(true);
tree->setItemsExpandable(false);
#endif
fd->setFileMode(QFileDialog::Directory);
fd->setOption(QFileDialog::ShowDirsOnly);
fd->setViewMode(QFileDialog::Detail);
fd->setDirectory("/mnt/large/pentalo/deep/datasets/");
int result = fd->exec();
QString directory;
if (result)
Expand Down Expand Up @@ -311,12 +312,13 @@ void MainWindow::handleDetectButton() {
void MainWindow::handleSelectOutputFolderButtonDetector() {
QFileDialog *fd = new QFileDialog;
QTreeView *tree = fd->findChild <QTreeView*>();
#ifndef __APPLE__
tree->setRootIsDecorated(true);
tree->setItemsExpandable(false);
#endif
fd->setFileMode(QFileDialog::Directory);
fd->setOption(QFileDialog::ShowDirsOnly);
fd->setViewMode(QFileDialog::Detail);
fd->setDirectory("/mnt/large/pentalo/deep/evaluations/");
int result = fd->exec();
QString directory;
if (result)
Expand All @@ -329,12 +331,13 @@ void MainWindow::handleSelectOutputFolderButtonDetector() {
void MainWindow::handleSelectDeployInputSource() {
QFileDialog *fd = new QFileDialog;
QTreeView *tree = fd->findChild <QTreeView*>();
#ifndef __APPLE__
tree->setRootIsDecorated(true);
tree->setItemsExpandable(false);
#endif
fd->setFileMode(QFileDialog::AnyFile);
// fd->setOption(QFileDialog::Show);
fd->setViewMode(QFileDialog::Detail);
fd->setDirectory("/mnt/large/Temporal/Series");
int result = fd->exec();
QString directory;
if (result)
Expand All @@ -347,12 +350,13 @@ void MainWindow::handleSelectDeployInputSource() {
void MainWindow::handleSelectOutputFolderButtonDeployer() {
QFileDialog *fd = new QFileDialog;
QTreeView *tree = fd->findChild <QTreeView*>();
#ifndef __APPLE__
tree->setRootIsDecorated(true);
tree->setItemsExpandable(false);
#endif
fd->setFileMode(QFileDialog::Directory);
//fd->setOption(QFileDialog::ShowDirsOnly);
fd->setViewMode(QFileDialog::Detail);
fd->setDirectory("/mnt/large/pentalo/deep/evaluations/");
int result = fd->exec();
QString directory;
if (result)
Expand Down
2 changes: 1 addition & 1 deletion DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</rect>
</property>
<property name="currentIndex">
<number>3</number>
<number>4</number>
</property>
<widget class="QWidget" name="tab_1">
<attribute name="title">
Expand Down
116 changes: 18 additions & 98 deletions DeepLearningSuite/DeepLearningSuiteLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,104 +9,24 @@ IF (DARKNET_ACTIVE)
include_directories(${DARKNET_INCLUDE_DIR})
ENDIF()

include_directories(
${OpenCV_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
${config_INCLUDE_DIRS}
${depthLib_INCLUDE_DIRS}
${comm_INCLUDE_DIRS}
${ros_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${utils_INCLUDE_DIRS}
${INTERFACES_CPP_DIR}
${jderobottypes_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}
${QT_INCLUDE_DIRS}
${DeepLearningSuite_INCLUDE_DIR}
)

SET( SOURCE_FILES
GenerationUtils/DepthForegroundSegmentator
GenerationUtils/BoundingValidator
GenerationUtils/BoundingRectGuiMover
GenerationUtils/DetectionsValidator
Regions/RectRegions
Regions/RleRegions
Regions/ContourRegions
Regions/Regions.h
DatasetConverters/DatasetConverter
DatasetConverters/readers/DatasetReader
Common/Matrix.h
Common/EvalMatrix
Common/Sample
DatasetConverters/readers/OwnDatasetReader
DatasetConverters/writers/YoloDatasetWriter
DatasetConverters/readers/YoloDatasetReader
DatasetConverters/writers/COCODatasetWriter
DatasetConverters/readers/COCODatasetReader
DatasetConverters/readers/PascalVOCDatasetReader
DatasetConverters/writers/PascalVOCDatasetWriter
DatasetConverters/readers/ImageNetDatasetReader
DatasetConverters/ClassTypeGeneric
Regions/Region
Regions/RectRegion
Regions/RleRegion
Regions/ContourRegion
Regions/maskApi
Detectors/Detector.h
DatasetConverters/readers/SpinelloDatasetReader
FrameworkEvaluator/FrameworkInferencer
Utils/StringHandler.h
Utils/Normalizations
FrameworkEvaluator/ClassStatistics
FrameworkEvaluator/DetectionsEvaluator
FrameworkEvaluator/MassInferencer
FrameworkEvaluator/StatsWriter
DatasetConverters/ClassTypeOwn
DatasetConverters/ClassTypeMapper
DatasetConverters/ClassType
DatasetConverters/Tree
Utils/Configuration
Utils/Key
Utils/SampleGenerationApp
DatasetConverters/readers/GenericDatasetReader
FrameworkEvaluator/GenericInferencer
DatasetConverters/writers/DatasetWriter
DatasetConverters/writers/OwnDatasetWriter
DatasetConverters/writers/GenericDatasetWriter
Utils/StatsUtils
DatasetConverters/liveReaders/GenericLiveReader
DatasetConverters/liveReaders/JderobotReader
DatasetConverters/liveReaders/RecorderReader
DatasetConverters/liveReaders/CameraReader
DatasetConverters/liveReaders/VideoReader
FrameworkEvaluator/GlobalStats
DatasetConverters/readers/PrincetonDatasetReader
Utils/JsonHelper.h
Utils/DepthUtils
FrameworkEvaluator/TensorFlowInferencer
FrameworkEvaluator/KerasInferencer
DatasetConverters/liveReaders/VideoReader
Utils/PathHelper
)


IF(DARKNET_ACTIVE)
SET( SOURCE_FILES ${SOURCE_FILES} FrameworkEvaluator/DarknetInferencer )
include_directories(${DARKNET_INCLUDE_DIR})
ENDIF()

IF(ENABLE_DNN_CAFFE)
SET( SOURCE_FILES ${SOURCE_FILES} FrameworkEvaluator/CaffeInferencer )
ENDIF()

#message("WARNING: DeepLearningSuite_INCLUDE_DIR ${DeepLearningSuite_INCLUDE_DIR}")


add_library (DeepLearningSuite SHARED ${SOURCE_FILES})

message("Python: ${PYTHON_LIBRARIES}")
add_subdirectory(Common)
add_subdirectory(DatasetConverters)
add_subdirectory(Detectors)
add_subdirectory(FrameworkEvaluator)
add_subdirectory(GenerationUtils)
add_subdirectory(Regions)
add_subdirectory(Utils)

add_library(DeepLearningSuite SHARED
$<TARGET_OBJECTS:DeepLearningSuite_Common>
$<TARGET_OBJECTS:DeepLearningSuite_DatasetConverters>
$<TARGET_OBJECTS:DeepLearningSuite_Detectors>
$<TARGET_OBJECTS:DeepLearningSuite_FrameworkEvaluator>
$<TARGET_OBJECTS:DeepLearningSuite_GenerationUtils>
$<TARGET_OBJECTS:DeepLearningSuite_Regions>
$<TARGET_OBJECTS:DeepLearningSuite_Utils>

)

TARGET_LINK_LIBRARIES(DeepLearningSuite
${EXTRA_LIBS}
Expand Down
14 changes: 14 additions & 0 deletions DeepLearningSuite/DeepLearningSuiteLib/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SET ( Common_SOURCE_FILES
Matrix.h
EvalMatrix
Sample
)

ADD_LIBRARY(DeepLearningSuite_Common OBJECT ${Common_SOURCE_FILES})

TARGET_INCLUDE_DIRECTORIES( DeepLearningSuite_Common PUBLIC
${OpenCV_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}
${DeepLearningSuite_INCLUDE_DIR}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
SET (DatasetConverters_SOURCE_FILES
DatasetConverter
readers/DatasetReader
readers/OwnDatasetReader
writers/YoloDatasetWriter
readers/YoloDatasetReader
writers/COCODatasetWriter
readers/COCODatasetReader
readers/PascalVOCDatasetReader
readers/PrincetonDatasetReader
writers/PascalVOCDatasetWriter
readers/ImageNetDatasetReader
readers/SpinelloDatasetReader
ClassTypeGeneric
ClassTypeOwn
ClassTypeMapper
ClassType
Tree
readers/GenericDatasetReader
writers/DatasetWriter
writers/OwnDatasetWriter
writers/GenericDatasetWriter
liveReaders/GenericLiveReader
liveReaders/JderobotReader
liveReaders/RecorderReader
liveReaders/CameraReader
liveReaders/VideoReader
liveReaders/VideoReader
)

ADD_LIBRARY(DeepLearningSuite_DatasetConverters OBJECT ${DatasetConverters_SOURCE_FILES})

TARGET_INCLUDE_DIRECTORIES( DeepLearningSuite_DatasetConverters PUBLIC
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
${config_INCLUDE_DIRS}
${comm_INCLUDE_DIRS}
${ros_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${utils_INCLUDE_DIRS}
${INTERFACES_CPP_DIR}
${jderobottypes_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}
${DeepLearningSuite_INCLUDE_DIR}
)
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ bool JderobotReader::getNextSample(Sample &sample) {

if (!image.empty()){
sample.setSampleID(std::to_string(++this->sample_count));
cv::cvtColor(image, image, cv::COLOR_RGB2BGR);
sample.setColorImage(image);
//sample.setDepthImage(image);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
#include <boost/algorithm/string/erase.hpp>
#include <glog/logging.h>

#if CV_MAJOR_VERSION == 2

namespace cv {
#define COLOR_RGB2BGR CV_RGB2BGR
}


#endif


RecorderReader::RecorderReader(const std::string &colorImagesPath, const std::string &depthImagesPath):DatasetReader(true), colorPath(colorImagesPath), depthPath(depthImagesPath) {
currentIndex=0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@
#include <Utils/JsonHelper.h>
#include <Utils/DepthUtils.h>

#if CV_MAJOR_VERSION == 2

namespace cv {
#define IMREAD_ANYDEPTH CV_LOAD_IMAGE_ANYDEPTH

}
#endif


PrincetonDatasetReader::PrincetonDatasetReader(const std::string &path, const std::string &classNamesFile,const bool imagesRequired):DatasetReader(imagesRequired) {
this->classNamesFile=classNamesFile;
Expand Down
Loading

0 comments on commit f72ce01

Please sign in to comment.