From 5f3ea247fbf6b676f9f649f86a1df69f548ff623 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Wed, 8 Aug 2018 19:41:05 +0530 Subject: [PATCH 1/9] added samples, now GUI evaluator also genrates a CSV, and changed docker file --- .../SamplerGeneratorHandler/Evaluator.cpp | 11 +++ .../liveReaders/RecorderReader.cpp | 9 -- .../readers/PrincetonDatasetReader.cpp | 8 -- .../readers/SpinelloDatasetReader.cpp | 10 --- .../DeepLearningSuiteLib/Regions/Regions.h | 12 --- DeepLearningSuite/Deps/qt/CMakeLists.txt | 9 +- DeepLearningSuite/Deps/ros/CMakeLists.txt | 4 +- DeepLearningSuite/Dockerfile/Dockerfile | 22 +---- DeepLearningSuite/TestCommit.txt | 0 .../Tools/Evaluator/evaluator.cpp | 10 +++ DeepLearningSuite/appConfig.txt | 17 ---- .../libs/utils/colorspaces/imagecv.cpp | 22 ----- samples/myAutoEvaluatorConfig.yml | 37 ++++++++ samples/myappConfig.yml | 11 +++ samples/names/coco.names | 90 +++++++++++++++++++ samples/names/spinello.names | 1 + samples/names/voc.names | 20 +++++ .../samplerConfig-princeton.txt | 0 .../samplerConfig-spinello.txt | 0 .../samplerConfig.txt | 0 20 files changed, 189 insertions(+), 104 deletions(-) delete mode 100644 DeepLearningSuite/TestCommit.txt delete mode 100644 DeepLearningSuite/appConfig.txt create mode 100755 samples/myAutoEvaluatorConfig.yml create mode 100755 samples/myappConfig.yml create mode 100755 samples/names/coco.names create mode 100755 samples/names/spinello.names create mode 100755 samples/names/voc.names rename {DeepLearningSuite => samples}/samplerConfig-princeton.txt (100%) rename {DeepLearningSuite => samples}/samplerConfig-spinello.txt (100%) rename {DeepLearningSuite => samples}/samplerConfig.txt (100%) diff --git a/DeepLearningSuite/DatasetEvaluationApp/SamplerGeneratorHandler/Evaluator.cpp b/DeepLearningSuite/DatasetEvaluationApp/SamplerGeneratorHandler/Evaluator.cpp index 6f6e2ad3..9a6165c8 100644 --- a/DeepLearningSuite/DatasetEvaluationApp/SamplerGeneratorHandler/Evaluator.cpp +++ b/DeepLearningSuite/DatasetEvaluationApp/SamplerGeneratorHandler/Evaluator.cpp @@ -3,6 +3,7 @@ // #include +#include #include "Evaluator.h" #include "SamplerGenerationHandler.h" @@ -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(); + } diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp index 7ab90310..73f29c80 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp @@ -10,15 +10,6 @@ #include #include -#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; diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp index d3a27176..358d4f4f 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp @@ -16,14 +16,6 @@ #include #include -#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; diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp index b34c5e70..d177e0a5 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp @@ -12,16 +12,6 @@ #include -#if CV_MAJOR_VERSION == 2 - -namespace cv { - - #define IMREAD_ANYDEPTH CV_LOAD_IMAGE_ANYDEPTH - -} - -#endif - SpinelloDatasetReader::SpinelloDatasetReader(const std::string &path,const std::string& classNamesFile,const bool imagesRequired):DatasetReader(imagesRequired) { this->classNamesFile=classNamesFile; appendDataset(path); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h b/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h index 740e695e..06a56804 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h @@ -10,18 +10,6 @@ #include -#if CV_MAJOR_VERSION == 2 - -namespace cv { // Fix for different opencv versions - -#define RETR_CCOMP CV_RETR_CCOMP -#define CHAIN_APPROX_SIMPLE CV_CHAIN_APPROX_SIMPLE - -} - -#endif - - struct Regions{ Regions(){}; virtual void saveJson(const std::string& outPath)=0; diff --git a/DeepLearningSuite/Deps/qt/CMakeLists.txt b/DeepLearningSuite/Deps/qt/CMakeLists.txt index 5d45ef62..a61e4a6d 100644 --- a/DeepLearningSuite/Deps/qt/CMakeLists.txt +++ b/DeepLearningSuite/Deps/qt/CMakeLists.txt @@ -3,10 +3,10 @@ OPTION(ENABLE_QT "Enable Qt support for GUI" ON) IF(ENABLE_QT) FIND_PACKAGE(Qt5Core) # Just to print error if Qt isn't found - FIND_PACKAGE(Qt5Widgets) - FIND_PACKAGE(Qt5Gui) - FIND_PACKAGE(Qt5Svg) - FIND_PACKAGE(Qt5OpenGL) + FIND_PACKAGE(Qt5Widgets QUIET) + FIND_PACKAGE(Qt5Gui QUIET) + FIND_PACKAGE(Qt5Svg QUIET) + FIND_PACKAGE(Qt5OpenGL QUIET) IF (Qt5Widgets_FOUND AND Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Svg_FOUND AND Qt5OpenGL_FOUND) @@ -26,7 +26,6 @@ IF(ENABLE_QT) ${Qt5OpenGL_LIBRARIES} ) - message(${QT_INCLUDE_DIRS}) SET(QT_FOUND TRUE) ELSE() diff --git a/DeepLearningSuite/Deps/ros/CMakeLists.txt b/DeepLearningSuite/Deps/ros/CMakeLists.txt index d79cced3..eb4068e2 100644 --- a/DeepLearningSuite/Deps/ros/CMakeLists.txt +++ b/DeepLearningSuite/Deps/ros/CMakeLists.txt @@ -1,5 +1,7 @@ OPTION(ENABLE_ROS "Enable ROS compatibility modules" ON) +SET (CMAKE_PREFIX_PATH "/opt/ros/kinetic;/opt/ros/lunar;/opt/ros/jade") + if (ENABLE_ROS) find_package(roscpp QUIET) @@ -7,8 +9,6 @@ if (ENABLE_ROS) MESSAGE("*** ROS LIBRARIES FOUND : ${roscpp_INCLUDE_DIRS}") - SET (CMAKE_PREFIX_PATH /opt/ros/kinetic) - set (CATKIN_BUILD_BINARY_PACKAGE 1) #doesn't add ROS environment files to package find_package(catkin REQUIRED COMPONENTS diff --git a/DeepLearningSuite/Dockerfile/Dockerfile b/DeepLearningSuite/Dockerfile/Dockerfile index 837bb28d..c44749e5 100644 --- a/DeepLearningSuite/Dockerfile/Dockerfile +++ b/DeepLearningSuite/Dockerfile/Dockerfile @@ -27,13 +27,6 @@ RUN apt-get install -y libboost-filesystem-dev libboost-system-dev libboost-thre libgtkglextmm-x11-1.2-dev libyaml-cpp-dev icestorm zeroc-ice libxml++2.6-dev qt5-default libqt5svg5-dev libtinyxml-dev \ catkin libssl-dev -RUN cd /opt/ && mkdir devel && cd devel && \ - git clone https://github.com/JdeRobot/ThirdParty && \ - cd ThirdParty && \ - cd qflightinstruments && \ - qmake qfi.pro && \ - make -j4 && \ - make install RUN useradd -ms /bin/bash docker RUN echo "docker ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers @@ -42,13 +35,6 @@ USER docker WORKDIR /home/docker -RUN mkdir -p devel && cd devel && \ - git clone https://github.com/JdeRobot/JdeRobot && \ - cd JdeRobot && \ - cmake . -DENABLE_ROS=OFF &&\ - make -j4 && \ - sudo make -j4 install - USER root RUN apt-get install -y libboost-program-options-dev USER docker @@ -69,9 +55,7 @@ RUN mkdir -p devel && cd devel && mkdir install && \ RUN cd devel && \ git clone https://github.com/JdeRobot/DeepLearningSuite && \ - cd DeepLearningSuite && \ - cd DeepLearningSuite/ && \ - cmake . -DDARKNET_PATH=$DARKNET_DIR -DJdeRobot_DIR=/opt/jderobot/share/jderobot/ && \ + cd DeepLearningSuite && mkdir build && \ + cd build/ && \ + cmake . -DDARKNET_PATH=$DARKNET_DIR && \ make -j4 - - diff --git a/DeepLearningSuite/TestCommit.txt b/DeepLearningSuite/TestCommit.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/DeepLearningSuite/Tools/Evaluator/evaluator.cpp b/DeepLearningSuite/Tools/Evaluator/evaluator.cpp index cc2b2dc5..332a8744 100644 --- a/DeepLearningSuite/Tools/Evaluator/evaluator.cpp +++ b/DeepLearningSuite/Tools/Evaluator/evaluator.cpp @@ -8,6 +8,7 @@ #include #include #include +#include class MyApp:public SampleGenerationApp{ @@ -52,6 +53,15 @@ class MyApp:public SampleGenerationApp{ evaluator->accumulateResults(); + std::string mywriterFile("Evaluation Results.csv" ); + + StatsWriter writer(readerGT->getReader(), mywriterFile); + + writer.writeInferencerResults("Detection Dataset", evaluator); + + writer.saveFile(); + + }; }; diff --git a/DeepLearningSuite/appConfig.txt b/DeepLearningSuite/appConfig.txt deleted file mode 100644 index a8ac52bb..00000000 --- a/DeepLearningSuite/appConfig.txt +++ /dev/null @@ -1,17 +0,0 @@ ---datasetPath -/mnt/large/pentalo/deep/datasets - ---evaluationsPath -/mnt/large/pentalo/deep/evaluations - ---weightsPath -/mnt/large/pentalo/deep/weights - ---netCfgPath -/mnt/large/pentalo/deep/cfg/darknet - ---namesPath -/mnt/large/pentalo/deep/cfg/SampleGenerator - ---inferencesPath -/mnt/large/pentalo/deep/evaluations diff --git a/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp b/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp index c0daaa3e..ab32202c 100644 --- a/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp +++ b/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp @@ -9,28 +9,6 @@ #include #include -#if CV_MAJOR_VERSION == 2 - -namespace cv { // Fix for different opencv versions - - #define COLOR_BGR2RGB CV_BGR2RGB - #define COLOR_RGB2BGR CV_RGB2BGR - #define COLOR_RGB2GRAY CV_RGB2GRAY - #define COLOR_RGB2YCrCb CV_RGB2YCrCb - #define COLOR_RGB2HSV CV_RGB2HSV - #define COLOR_RGB2YCrCb CV_RGB2YCrCb - #define COLOR_YCrCb2RGB CV_YCrCb2RGB - #define COLOR_GRAY2RGB CV_GRAY2RGB - #define COLOR_HSV2RGB CV_HSV2RGB - #define COLOR_YCrCb2RGB CV_YCrCb2RGB - #define COLOR_RGB2YCrCb CV_RGB2YCrCb - - - -} - -#endif - namespace colorspaces { Image::Format::Format(const std::string name, const int id, const int cvType, imageCtor ctor, imageCvt cvt) diff --git a/samples/myAutoEvaluatorConfig.yml b/samples/myAutoEvaluatorConfig.yml new file mode 100755 index 00000000..c2962e90 --- /dev/null +++ b/samples/myAutoEvaluatorConfig.yml @@ -0,0 +1,37 @@ +Datasets: + +- + inputPath: /opt/datasets/coco/annotations2017/instances_val2017.json + readerImplementation: COCO + readerNames: /opt/datasets/names/coco.names + + +Inferencers: + +- + inferencerWeights: /opt/datasets/weights/ssd_mobilenet_v1_coco_2017_11_17/frozen_inference_graph.pb + inferencerConfig: /opt/datasets/cfg/foo.cfg + inferencerImplementation: tensorflow + inferencerNames: /opt/datasets/names/coco.names + +- + inferencerWeights: /opt/datasets/weights/ssd_inception_v2_coco_2017_11_17/frozen_inference_graph.pb + inferencerConfig: /opt/datasets/cfg/foo.cfg + inferencerImplementation: tensorflow + inferencerNames: /opt/datasets/names/coco.names + + +outputCSVPath: /opt/datasets/output + + + + + + + + + + + + + diff --git a/samples/myappConfig.yml b/samples/myappConfig.yml new file mode 100755 index 00000000..7aa6af9e --- /dev/null +++ b/samples/myappConfig.yml @@ -0,0 +1,11 @@ +datasetPath: /opt/datasets + +evaluationsPath: /opt/datasets/eval + +weightsPath: /opt/datasets/weights + +netCfgPath: /opt/datasets/cfg + +namesPath: /opt/datasets/names + +inferencesPath: /opt/datasets diff --git a/samples/names/coco.names b/samples/names/coco.names new file mode 100755 index 00000000..5337c681 --- /dev/null +++ b/samples/names/coco.names @@ -0,0 +1,90 @@ +person +bicycle +car +motorcycle +airplane +bus +train +truck +boat +trafficlight +firehydrant + +stopsign +parkingmeter +bench +bird +cat +dog +horse +sheep +cow +elephant +bear +zebra +giraffe + +backpack +umbrella + + +handbag +tie +suitcase +frisbee +skis +snowboard +sportsball +kite +baseballbat +baseballglove +skateboard +surfboard +tennisracket +bottle + +wineglass +cup +fork +knife +spoon +bowl +banana +apple +sandwich +orange +broccoli +carrot +hotdog +pizza +donut +cake +chair +couch +pottedplant +bed + +diningtable + + +toilet + +tv +laptop +mouse +remote +keyboard +cellphone +microwave +oven +toaster +sink +refrigerator + +book +clock +vase +scissors +teddybear +hairdrier +toothbrush diff --git a/samples/names/spinello.names b/samples/names/spinello.names new file mode 100755 index 00000000..1864de66 --- /dev/null +++ b/samples/names/spinello.names @@ -0,0 +1 @@ +person diff --git a/samples/names/voc.names b/samples/names/voc.names new file mode 100755 index 00000000..8420ab35 --- /dev/null +++ b/samples/names/voc.names @@ -0,0 +1,20 @@ +aeroplane +bicycle +bird +boat +bottle +bus +car +cat +chair +cow +diningtable +dog +horse +motorbike +person +pottedplant +sheep +sofa +train +tvmonitor diff --git a/DeepLearningSuite/samplerConfig-princeton.txt b/samples/samplerConfig-princeton.txt similarity index 100% rename from DeepLearningSuite/samplerConfig-princeton.txt rename to samples/samplerConfig-princeton.txt diff --git a/DeepLearningSuite/samplerConfig-spinello.txt b/samples/samplerConfig-spinello.txt similarity index 100% rename from DeepLearningSuite/samplerConfig-spinello.txt rename to samples/samplerConfig-spinello.txt diff --git a/DeepLearningSuite/samplerConfig.txt b/samples/samplerConfig.txt similarity index 100% rename from DeepLearningSuite/samplerConfig.txt rename to samples/samplerConfig.txt From f1a495085aebc86913cd6b2492f09d3c1e0e7413 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Wed, 8 Aug 2018 19:44:20 +0530 Subject: [PATCH 2/9] changed opencv search path --- DeepLearningSuite/Deps/opencv/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeepLearningSuite/Deps/opencv/CMakeLists.txt b/DeepLearningSuite/Deps/opencv/CMakeLists.txt index 78087fe6..7db5a7f3 100644 --- a/DeepLearningSuite/Deps/opencv/CMakeLists.txt +++ b/DeepLearningSuite/Deps/opencv/CMakeLists.txt @@ -1,4 +1,4 @@ -FIND_PACKAGE(OpenCV) +FIND_PACKAGE(OpenCV NO_DEFAULT_PATH PATHS "/usr/local" ) if(OpenCV_FOUND) include(CheckIncludeFileCXX) From 910ff62b370fbdf4af179c284292348d7e98a863 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Wed, 8 Aug 2018 19:51:14 +0530 Subject: [PATCH 3/9] changed cvSize to cv::Size --- DeepLearningSuite/libs/utils/CameraUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DeepLearningSuite/libs/utils/CameraUtils.cpp b/DeepLearningSuite/libs/utils/CameraUtils.cpp index a2be4993..4139f4e5 100644 --- a/DeepLearningSuite/libs/utils/CameraUtils.cpp +++ b/DeepLearningSuite/libs/utils/CameraUtils.cpp @@ -45,7 +45,7 @@ cv::Mat CameraUtils::getImageFromCameraProxy(jderobot::ImageDataPtr dataPtr) { { colorspaces::Image imageRGB(dataPtr->description->width,dataPtr->description->height,colorspaces::ImageRGB8::FORMAT_RGB8,&(origin_buf[0])); colorspaces::ImageRGB8 img_rgb888(imageRGB);//conversion will happen if needed - cv::Mat(cvSize(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data).copyTo(outImage); + cv::Mat(cv::Size(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data).copyTo(outImage); img_rgb888.release(); } @@ -59,7 +59,7 @@ cv::Mat CameraUtils::getImageFromCameraProxy(jderobot::ImageDataPtr dataPtr) { { colorspaces::Image imageRGB(dataPtr->description->width,dataPtr->description->height,colorspaces::ImageRGB8::FORMAT_RGB8,&(dataPtr->pixelData[0])); colorspaces::ImageRGB8 img_rgb888(imageRGB);//conversion will happen if needed - cv::Mat(cvSize(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data).copyTo(outImage); + cv::Mat(cv::Size(img_rgb888.width,img_rgb888.height), CV_8UC3, img_rgb888.data).copyTo(outImage); img_rgb888.release(); } else if (dataPtr->description->format == colorspaces::ImageGRAY8::FORMAT_GRAY8_Z.get()->name) { @@ -90,7 +90,7 @@ cv::Mat CameraUtils::getImageFromCameraProxy(jderobot::ImageDataPtr dataPtr) { colorspaces::Image imageGray(dataPtr->description->width,dataPtr->description->height,colorspaces::ImageGRAY8::FORMAT_GRAY8,&(origin_buf[0])); colorspaces::ImageGRAY8 img_gray8(imageGray);//conversion will happen if needed - cv::Mat(cvSize(img_gray8.width,img_gray8.height), CV_8UC1, img_gray8.data).copyTo(outImage); + cv::Mat(cv::Size(img_gray8.width,img_gray8.height), CV_8UC1, img_gray8.data).copyTo(outImage); img_gray8.release(); } @@ -101,7 +101,7 @@ cv::Mat CameraUtils::getImageFromCameraProxy(jderobot::ImageDataPtr dataPtr) { else if (dataPtr->description->format == colorspaces::ImageGRAY8::FORMAT_GRAY8.get()->name){ colorspaces::Image imageGray(dataPtr->description->width,dataPtr->description->height,colorspaces::ImageGRAY8::FORMAT_GRAY8,&(dataPtr->pixelData[0])); colorspaces::ImageGRAY8 img_gray8(imageGray);//conversion will happen if needed - cv::Mat(cvSize(img_gray8.width,img_gray8.height), CV_8UC1, img_gray8.data).copyTo(outImage); + cv::Mat(cv::Size(img_gray8.width,img_gray8.height), CV_8UC1, img_gray8.data).copyTo(outImage); img_gray8.release(); } else{ From 07ffa581282ec8e0f223412e775904e43525b11c Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Thu, 9 Aug 2018 10:39:37 +0530 Subject: [PATCH 4/9] changed DeepLearningSuiteLib build structure --- .../DeepLearningSuiteLib/CMakeLists.txt | 116 +++--------------- .../Common/CMakeLists.txt | 14 +++ .../DatasetConverters/CMakeLists.txt | 45 +++++++ .../Detectors/CMakeLists.txt | 21 ++++ .../FrameworkEvaluator/CMakeLists.txt | 37 ++++++ .../MassBatchInferencer.cpp | 0 .../FrameworkEvaluator/MassBatchInferencer.h | 31 ----- .../GenerationUtils/CMakeLists.txt | 21 ++++ .../Regions/CMakeLists.txt | 26 ++++ .../DeepLearningSuiteLib/Utils/CMakeLists.txt | 26 ++++ 10 files changed, 208 insertions(+), 129 deletions(-) create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/Common/CMakeLists.txt create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/Detectors/CMakeLists.txt create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt delete mode 100644 DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.cpp delete mode 100644 DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/CMakeLists.txt create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/Regions/CMakeLists.txt create mode 100644 DeepLearningSuite/DeepLearningSuiteLib/Utils/CMakeLists.txt diff --git a/DeepLearningSuite/DeepLearningSuiteLib/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/CMakeLists.txt index 7687e7fa..2898d431 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/CMakeLists.txt +++ b/DeepLearningSuite/DeepLearningSuiteLib/CMakeLists.txt @@ -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_LINK_LIBRARIES(DeepLearningSuite ${EXTRA_LIBS} diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Common/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/Common/CMakeLists.txt new file mode 100644 index 00000000..24073502 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/Common/CMakeLists.txt @@ -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} +) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt new file mode 100644 index 00000000..c7c80632 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt @@ -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} +) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Detectors/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/Detectors/CMakeLists.txt new file mode 100644 index 00000000..6a0fe529 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/Detectors/CMakeLists.txt @@ -0,0 +1,21 @@ +SET(Detectors_SOURCE_FILES + Detector.h +) + +ADD_LIBRARY(DeepLearningSuite_Detectors OBJECT ${Detectors_SOURCE_FILES}) + +TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_Detectors PUBLIC + ${OpenCV_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ${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} + +) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt new file mode 100644 index 00000000..68001de9 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt @@ -0,0 +1,37 @@ +SET(FrameworkEvaluator_SOURCE_FILES + ClassStatistics + FrameworkInferencer + GlobalStats + DetectionsEvaluator + MassInferencer + StatsWriter + GenericInferencer + TensorFlowInferencer + KerasInferencer +) + +IF(DARKNET_ACTIVE) + SET( FrameworkEvaluator_SOURCE_FILES ${FrameworkEvaluator_SOURCE_FILES} DarknetInferencer ) +ENDIF() + +IF(ENABLE_DNN_CAFFE) + SET( FrameworkEvaluator_SOURCE_FILES ${FrameworkEvaluator_SOURCE_FILES} CaffeInferencer ) +ENDIF() + +ADD_LIBRARY(DeepLearningSuite_FrameworkEvaluator OBJECT ${FrameworkEvaluator_SOURCE_FILES}) + + + +TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_FrameworkEvaluator PUBLIC + ${OpenCV_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ${GLOG_INCLUDE_DIRS} + ${CMAKE_CURRENT_LIST_DIR} + ${DeepLearningSuite_INCLUDE_DIR} + +) + +IF(DARKNET_ACTIVE) + TARGET_INCLUDE_DIRECTORIES( DeepLearningSuite_FrameworkEvaluator ${DARKNET_INCLUDE_DIR}) +ENDIF() diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.cpp b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.cpp deleted file mode 100644 index e69de29b..00000000 diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h deleted file mode 100644 index 100a5da1..00000000 --- a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SAMPLERGENERATOR_MASSINFERENCER_H -#define SAMPLERGENERATOR_MASSINFERENCER_H - -#include -#include - -class MassInferencer { -public: - MassBatchInferencer(DatasetReaderPtr reader, FrameworkInferencerPtr inferencer, const std::string& resultsPath, double* confidence_threshold = NULL, bool debug=true); - MassBatchInferencer(DatasetReaderPtr reader, FrameworkInferencerPtr inferencer, const std::string& resultsPath, bool debug=true); - MassBatchInferencer(DatasetReaderPtr reader, FrameworkInferencerPtr inferencer, const std::string &resultsPath, bool* stopDeployer, double* confidence_threshold = NULL, bool debug=true); - MassBatchInferencer(DatasetReaderPtr reader, FrameworkInferencerPtr inferencer, double* confidence_threshold = NULL, bool debug=true); - MassBatchInferencer(DatasetReaderPtr reader, FrameworkInferencerPtr inferencer, bool debug=true); - void process(int batch_size, bool writeImages, DatasetReaderPtr readerDetection = NULL); - -private: - DatasetReaderPtr reader; - FrameworkInferencerPtr inferencer; - std::string resultsPath; - bool debug; - bool saveOutput; - int alreadyProcessed; - bool* stopDeployer = NULL; - double* confidence_threshold = NULL; - double default_confidence_threshold = 0.2; - -}; - - - -#endif //SAMPLERGENERATOR_MASSINFERENCER_H diff --git a/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/CMakeLists.txt new file mode 100644 index 00000000..dcde7b4c --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/CMakeLists.txt @@ -0,0 +1,21 @@ +SET(GenerationUtils_SOURCE_FILES + DepthForegroundSegmentator + BoundingValidator + BoundingRectGuiMover + DetectionsValidator +) + +ADD_LIBRARY(DeepLearningSuite_GenerationUtils OBJECT ${GenerationUtils_SOURCE_FILES}) + + + +TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_GenerationUtils PUBLIC + ${OpenCV_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ${GLOG_INCLUDE_DIRS} + ${depthLib_INCLUDE_DIRS} + ${utils_INCLUDE_DIRS} + ${CMAKE_CURRENT_LIST_DIR} + ${DeepLearningSuite_INCLUDE_DIR} + +) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Regions/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/Regions/CMakeLists.txt new file mode 100644 index 00000000..29d6adb8 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/CMakeLists.txt @@ -0,0 +1,26 @@ +SET(Regions_SOURCE_FILES + RectRegions + RleRegions + ContourRegions + Regions.h + Region + RectRegion + RleRegion + ContourRegion + maskApi +) + +ADD_LIBRARY(DeepLearningSuite_Regions OBJECT ${Regions_SOURCE_FILES}) + + + +TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_Regions PUBLIC + ${OpenCV_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ${GLOG_INCLUDE_DIRS} + ${utils_INCLUDE_DIRS} + ${CMAKE_CURRENT_LIST_DIR} + ${QT_INCLUDE_DIRS} + ${DeepLearningSuite_INCLUDE_DIR} + +) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Utils/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/Utils/CMakeLists.txt new file mode 100644 index 00000000..441f2982 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/Utils/CMakeLists.txt @@ -0,0 +1,26 @@ +SET(Utils_SOURCE_FILES + StringHandler.h + Normalizations + Configuration + Key + SampleGenerationApp + StatsUtils + JsonHelper.h + DepthUtils + PathHelper +) + +ADD_LIBRARY(DeepLearningSuite_Utils OBJECT ${Utils_SOURCE_FILES}) + + +TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_Utils PUBLIC + ${OpenCV_INCLUDE_DIRS} + ${Boost_INCLUDE_DIR} + ${config_INCLUDE_DIRS} + ${depthLib_INCLUDE_DIRS} + ${GLOG_INCLUDE_DIRS} + ${utils_INCLUDE_DIRS} + ${CMAKE_CURRENT_LIST_DIR} + ${DeepLearningSuite_INCLUDE_DIR} + +) From 3ed487ff8cb36f4d4bf8a79d1be7dd287261602b Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Thu, 9 Aug 2018 20:15:51 +0530 Subject: [PATCH 5/9] Added ROS and ICE to a different AppImage --- .travis.yml | 19 ++++++++++++++++-- .../DatasetEvaluationApp/main.cpp | 3 ++- .../DatasetConverters/CMakeLists.txt | 2 +- .../liveReaders/JderobotReader.cpp | 1 + .../FrameworkEvaluator/CMakeLists.txt | 2 +- .../python_modules/tensorflow_detect.pyc | Bin 3895 -> 3865 bytes DeepLearningSuite/package.sh | 17 ++++++++++++++++ install_darknet.sh | 19 ++++++++++++++++++ 8 files changed, 58 insertions(+), 5 deletions(-) create mode 100755 install_darknet.sh diff --git a/.travis.yml b/.travis.yml index 37e20637..6d79423a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,13 @@ cache: pip: true directories: - $HOME/opencv/ + - $HOME/darknet/ + +matrix: + include: + - env: TO_TEST=WITH_ROS_AND_ICE + fast_finish: true + before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi @@ -37,8 +44,15 @@ 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 - sudo pip install numpy - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./install_opencv.sh ; fi + - ./install_darknet.sh before_script: - cd DeepLearningSuite @@ -50,8 +64,8 @@ script: make -j4 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 source ../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/* @@ -60,3 +74,4 @@ branches: except: - # Do not build tags that we create when we upload to GitHub Releases - /^(?i:continuous)$/ + diff --git a/DeepLearningSuite/DatasetEvaluationApp/main.cpp b/DeepLearningSuite/DatasetEvaluationApp/main.cpp index a3fb871e..8503b9ec 100644 --- a/DeepLearningSuite/DatasetEvaluationApp/main.cpp +++ b/DeepLearningSuite/DatasetEvaluationApp/main.cpp @@ -1,7 +1,7 @@ #include "mainwindow.h" #include #include - +#include class MyApp:public SampleGenerationApp{ public: @@ -17,6 +17,7 @@ class MyApp:public SampleGenerationApp{ MainWindow w(this); w.show(); + a.exec(); }; diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt index c7c80632..f2935075 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/CMakeLists.txt @@ -7,7 +7,7 @@ SET (DatasetConverters_SOURCE_FILES writers/COCODatasetWriter readers/COCODatasetReader readers/PascalVOCDatasetReader - readers/PrincetondatasetReader + readers/PrincetonDatasetReader writers/PascalVOCDatasetWriter readers/ImageNetDatasetReader readers/SpinelloDatasetReader diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/JderobotReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/JderobotReader.cpp index 5bc1ce55..a2d01102 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/JderobotReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/JderobotReader.cpp @@ -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); } diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt index 68001de9..b5325e4e 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt +++ b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/CMakeLists.txt @@ -33,5 +33,5 @@ TARGET_INCLUDE_DIRECTORIES ( DeepLearningSuite_FrameworkEvaluator PUBLIC ) IF(DARKNET_ACTIVE) - TARGET_INCLUDE_DIRECTORIES( DeepLearningSuite_FrameworkEvaluator ${DARKNET_INCLUDE_DIR}) + TARGET_INCLUDE_DIRECTORIES( DeepLearningSuite_FrameworkEvaluator PUBLIC ${DARKNET_INCLUDE_DIR}) ENDIF() diff --git a/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc b/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc index 891175041c330caaa42b429c900cb3c8fe5c3eeb..a4f32d65ce089c549d7b4476eb878453b7efbf43 100644 GIT binary patch delta 162 zcmdlkH&c$C`7ZfOxOt$B(-K@#7i3zuC hI{QCH+_E1zopI}(e1N9_tJcl-ylS`&o&1qc0{~&0KJWkl diff --git a/DeepLearningSuite/package.sh b/DeepLearningSuite/package.sh index 5d44cb86..9588b313 100644 --- a/DeepLearningSuite/package.sh +++ b/DeepLearningSuite/package.sh @@ -8,7 +8,13 @@ export ARCH=$(arch) +if [[ "$TO_TEST" == "WITH_ROS_AND_ICE" ]]; +then +APP=DetectionSuite_with_ROS_and_ICE +else APP=DetectionSuite +fi + LOWERAPP=${APP,,} @@ -23,6 +29,14 @@ echo `pwd` mkdir -p usr/bin cp ../DatasetEvaluationApp/DatasetEvaluationApp usr/bin/ + +out=`find /opt -name "setup.bash"` +if [ -a "$out" ] +then +source $out +fi + + mkdir -p usr/lib ldd ../DatasetEvaluationApp/DatasetEvaluationApp | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' usr/lib/ @@ -76,4 +90,7 @@ echo `pwd` mkdir out cd out + ../appimagetool-x86_64.AppImage ../$APP.AppDir + +cd .. # Since this is being run in the same shell it is necssary to go backwards diff --git a/install_darknet.sh b/install_darknet.sh new file mode 100755 index 00000000..b2752203 --- /dev/null +++ b/install_darknet.sh @@ -0,0 +1,19 @@ +#!/bin/sh +if [ -n "$(ls -A $HOME/darknet/build)" ]; + then + # We're using a cached version of our OpenCV build + cd $HOME/darknet/build; + sudo make install + else + # No OpenCV cache – clone and make the files + rm -rf $HOME/darknet; + cd $HOME + git clone https://github.com/JdeRobot/darknet.git + cd darknet + mkdir build && cd build + cmake -DUSE_GPU=OFF .. + make -j4 + sudo make install + fi + + From 164bd5306be15410560d442c47d9b1f54e7cdbb0 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Fri, 10 Aug 2018 16:27:16 +0530 Subject: [PATCH 6/9] deployer is now the defualt tab of DatasetEvaluationApp --- DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui b/DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui index 5c48c217..3a7fe81a 100644 --- a/DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui +++ b/DeepLearningSuite/DatasetEvaluationApp/mainwindow.ui @@ -24,7 +24,7 @@ - 3 + 4 From 7d32ee3dab536640c2c9fd539914d78b869efc09 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Fri, 10 Aug 2018 18:57:45 +0530 Subject: [PATCH 7/9] updated readme --- .../writers/PascalVOCDatasetWriter.cpp | 4 +-- README.md | 35 ++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/writers/PascalVOCDatasetWriter.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/writers/PascalVOCDatasetWriter.cpp index f866b62a..4fd226c0 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/writers/PascalVOCDatasetWriter.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/writers/PascalVOCDatasetWriter.cpp @@ -134,7 +134,7 @@ void PascalVOCDatasetWriter::process(bool writeImages, bool useDepth) { } - if (writerNamesFile.empty()) { + if (!writerNamesFile.empty()) { std::ofstream writerClassfile; writerClassfile.open (this->fullNamesPath); @@ -149,7 +149,7 @@ void PascalVOCDatasetWriter::process(bool writeImages, bool useDepth) { LOG(INFO) << "Successfully Converted given Dataset to Pascal VOC dataset\n"; - if (writerNamesFile.empty()) { + if (!writerNamesFile.empty()) { std::cout << "\nPrinting Mapping Info\n"; std::cout << "**********************\n"; diff --git a/README.md b/README.md index a6a86366..f252ec69 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # DeepLearningSuite + +[![Build Status](https://travis-ci.org/vinay0410/dl-DetectionSuite.svg?branch=master)](https://travis-ci.org/vinay0410/dl-DetectionSuite) + DeepLearning Suite is a set of tool that simplify the evaluation of most common object detection datasets with several object detection neural networks. The idea is to offer a generic infrastructure to evaluates object detection algorithms againts a dataset and compute most common statistics: @@ -34,10 +37,40 @@ The idea is to offer a generic infrastructure to evaluates object detection algo * Streams from ICE * JdeRobot Recorder Logs -# Sample generation Tool + +## Sample generation Tool Sample Generation Tool has been developed in order to simply the process of generation samples for datasets focused on object detection. The tools provides some features to reduce the time on labelling objects as rectangles. +# Installation +#### We have AppImages !!! +### [Download from here](https://github.com/vinay0410/dl-DetectionSuite/releases/tag/continuous) + +
+To run, +First give executable permissions by running +```chmod a+x DetectionSuitexxxxx.AppImage ``` +And Run it by +```./DetectionSuitexxxxx -c configFile ``` + + +Though you would need `python` in your system installed with `numpy`. +Also, for using TensorFlow, you would need to tensorflow, and similaraly for keras you would need to install Keras. + +If required they can be installed by +``` +pip install tensorflow +``` +or + +``` +pip install tensorflow-gpu +``` +Similrarly for keras: +``` +pip install keras +``` + # Requirements ### Common deps From 69e77dddf837bd308f0864cf74d01c394ccc65f0 Mon Sep 17 00:00:00 2001 From: Vinay Sharma Date: Fri, 10 Aug 2018 21:03:57 +0530 Subject: [PATCH 8/9] fixed macos select input file/folder crash --- .../DatasetEvaluationApp/mainwindow.cpp | 12 ++++++++---- .../TensorFlowInferencer.cpp | 5 +++-- .../Regions/RleRegions.cpp | 1 - .../python_modules/tensorflow_detect.pyc | Bin 3865 -> 3835 bytes 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/DeepLearningSuite/DatasetEvaluationApp/mainwindow.cpp b/DeepLearningSuite/DatasetEvaluationApp/mainwindow.cpp index 61f79380..6149a9d9 100644 --- a/DeepLearningSuite/DatasetEvaluationApp/mainwindow.cpp +++ b/DeepLearningSuite/DatasetEvaluationApp/mainwindow.cpp @@ -218,12 +218,13 @@ void MainWindow::setupTabsInformation() { void MainWindow::handleSelectOutputFolderButton() { QFileDialog *fd = new QFileDialog; QTreeView *tree = fd->findChild (); +#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) @@ -311,12 +312,13 @@ void MainWindow::handleDetectButton() { void MainWindow::handleSelectOutputFolderButtonDetector() { QFileDialog *fd = new QFileDialog; QTreeView *tree = fd->findChild (); +#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) @@ -329,12 +331,13 @@ void MainWindow::handleSelectOutputFolderButtonDetector() { void MainWindow::handleSelectDeployInputSource() { QFileDialog *fd = new QFileDialog; QTreeView *tree = fd->findChild (); +#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) @@ -347,12 +350,13 @@ void MainWindow::handleSelectDeployInputSource() { void MainWindow::handleSelectOutputFolderButtonDeployer() { QFileDialog *fd = new QFileDialog; QTreeView *tree = fd->findChild (); +#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) diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/TensorFlowInferencer.cpp b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/TensorFlowInferencer.cpp index 868128f4..3003cfbe 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/TensorFlowInferencer.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/TensorFlowInferencer.cpp @@ -181,8 +181,9 @@ void TensorFlowInferencer::output_result(int num_detections, int width, int heig cv::threshold(mask_char, mask_char, 127, 255, cv::THRESH_BINARY); mask_char.copyTo(image_mask(cv::Rect(detections[i].boundingBox.x,detections[i].boundingBox.y,detections[i].boundingBox.width, detections[i].boundingBox.height))); - RLE forMask; - rleEncode( &forMask, image_mask.data, image_mask.rows, image_mask.cols, 1 ); + RLE forMask; + cv::Mat t_mask = image_mask.t(); + rleEncode( &forMask, t_mask.data, t_mask.cols, t_mask.rows, 1 ); //std::cout << rleToString(&forMask) << '\n'; //cv::Mat matrix_decoded(image_mask.rows, image_mask.cols, CV_8U); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp b/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp index def911e2..9af6b892 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp @@ -90,7 +90,6 @@ void RleRegions::drawRegions(cv::Mat &image) { mask = mask * 255; cv::Mat rotatedMask = mask.t(); - cv::Scalar color; std::vector > contours; if (it->isCrowd) { diff --git a/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc b/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc index a4f32d65ce089c549d7b4476eb878453b7efbf43..fe8e72876aa03b8b3b156a47ba5b8164bf7d1411 100644 GIT binary patch delta 185 zcmbO!_gj{o`7BE^;1&ICf9KmZ`Nel#DqhZ nuVQl!`%gx!vYYETx8c&qSu*(`Pd-*{AS);D;a!PCl5aKuL0>+e delta 219 zcmew@J5!FG`7 Date: Sat, 11 Aug 2018 00:55:16 +0530 Subject: [PATCH 9/9] Squashed commit of the following: commit c72ddc6486a4a353f0cf10213db8e2d5c9d6e720 Author: Vinay Sharma Date: Sat Aug 11 00:30:29 2018 +0530 removed source package.sh commit 0ca3b68025611f6b32671c3353f342909814c4f8 Author: Vinay Sharma Date: Sat Aug 11 00:19:50 2018 +0530 updated scripts commit bf87db77da50dcd9a8b9fc486f94fb5fc0fa2eaa Author: Vinay Sharma Date: Fri Aug 10 23:45:16 2018 +0530 reduced paralled jobs and added travis_wait commit 792d258a1f3c6e12769beeb7c0c1a41d4817125d Merge: 6dad05d 69e77dd Author: Vinay Sharma Date: Fri Aug 10 23:43:07 2018 +0530 fixed conflicts commit 6dad05dd53f68677dcb35d50cac65dd022a72a69 Author: Vinay Sharma Date: Thu Aug 9 20:13:56 2018 +0530 final build commit 19b59f45594073a2e43da8af84de086fbaa6d5c5 Author: Vinay Sharma Date: Thu Aug 9 18:52:54 2018 +0530 qt style override commit 9d24c76734ec2f737022fdcccbe3602f68b5d592 Author: Vinay Sharma Date: Thu Aug 9 15:49:44 2018 +0530 fixed opencv bug commit a55df6c39b1080df880927635606c5d060615eaa Author: Vinay Sharma Date: Thu Aug 9 15:41:44 2018 +0530 darknet build without gpu commit 0b3b1a41e6a7dad37a8e7381d18db6ed7ab975ea Author: Vinay Sharma Date: Thu Aug 9 15:38:56 2018 +0530 darknet build without gpu commit 24c12bbbb4fb35da124e896bb18bd62c602db314 Author: Vinay Sharma Date: Thu Aug 9 15:29:46 2018 +0530 cached darknet installation commit 131b378d5b40cb1e7c7023b5dc3ae0af5073724f Author: Vinay Sharma Date: Thu Aug 9 15:22:00 2018 +0530 fixed bug commit 162be88f0acc5d2adc2c763567a6fc65486ddfa1 Author: Vinay Sharma Date: Thu Aug 9 14:59:35 2018 +0530 packaging linux builds only commit 4a042b49d8dbf2ac92f9a464eb37619b7cbdb448 Author: Vinay Sharma Date: Thu Aug 9 14:39:12 2018 +0530 made packing script executable commit 968da9c0243719c582f04cb3aba8dca6626184e8 Author: Vinay Sharma Date: Thu Aug 9 14:03:38 2018 +0530 setup ros env varibles commit f42a9eb3dc24ec6f8ed3df2cffa590b5f826987a Author: Vinay Sharma Date: Thu Aug 9 13:30:49 2018 +0530 debug ldd commit 27cfcb80364d7d9526522bc5ff6ce263bdd586a3 Author: Vinay Sharma Date: Thu Aug 9 07:01:35 2018 +0000 change packagename for ROS and Ice commit 482cad83f5453a6404c64e96f7b81cf0b2bbd031 Author: Vinay Sharma Date: Thu Aug 9 06:56:53 2018 +0000 fixed ice dependencies commit 7f313af1ae5cead97595c59cf03cf6ea28bbfc75 Author: Vinay Sharma Date: Thu Aug 9 06:46:10 2018 +0000 removed redundant job commit 37cc0fae260703051da171c4dfcd0475499f79bb Author: Vinay Sharma Date: Thu Aug 9 06:05:25 2018 +0000 fixed syntax error commit 149eb0d2787283c57fdc77576ae848e2fd8e9504 Author: Vinay Sharma Date: Thu Aug 9 06:01:01 2018 +0000 fixed syntax error commit daa33fcddf99f6947012018d46b507aefc83e3e2 Author: Vinay Sharma Date: Thu Aug 9 05:57:50 2018 +0000 fixed syntax error commit 6c381300794b6d296bb39a5051b109c43b0104be Author: Vinay Sharma Date: Thu Aug 9 05:43:49 2018 +0000 added ros and ice builds in travis ci commit c318d8650d88bdbf4c8eee3fbaaa341d8fae0309 Author: Vinay Sharma Date: Thu Aug 9 05:16:57 2018 +0000 fixed ROS OpenCV conflicting with original --- .travis.yml | 19 ++++-------------- .../python_modules/tensorflow_detect.pyc | Bin 3835 -> 0 bytes DeepLearningSuite/package.sh | 10 --------- install_darknet.sh | 2 +- install_opencv.sh | 3 +-- 5 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc diff --git a/.travis.yml b/.travis.yml index 6d79423a..e76f5db5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,5 @@ language: cpp -# blacklist -branches: - except: - - master - -# whitelist -branches: - only: - - travis-test - os: - linux - osx @@ -30,7 +20,6 @@ cache: matrix: include: - env: TO_TEST=WITH_ROS_AND_ICE - fast_finish: true before_install: @@ -50,6 +39,7 @@ before_install: - 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 @@ -60,18 +50,17 @@ before_script: - cd build - cmake .. -script: make -j4 +script: make -j2 after_success: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then source ../package.sh ; fi # To run the script in the same shell so as to setup environment variables + - 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: except: - # Do not build tags that we create when we upload to GitHub Releases - /^(?i:continuous)$/ - diff --git a/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc b/DeepLearningSuite/DeepLearningSuiteLib/python_modules/tensorflow_detect.pyc deleted file mode 100644 index fe8e72876aa03b8b3b156a47ba5b8164bf7d1411..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3835 zcmd5goH;XdF5jGUQhGbvxc}$i=MGK&O6b4A zXZ}DF;io7e+EfQ)k2XEhCDI;69=-C&+@h#NJ;juuOzGjS3T;*ocGYOJMp{vSilQ<_ z6?#QV=_>W>6jf=PsMsgnpr}T#6#b&)6tIF)r(X%&^wZ`v%d*j$hFtMK_H-~wz2qWDbWy7Lrb!xJrn`FDq zI5jp*lF-Ik+O%17hj)I`%!(#xy0~f=aK;niUkCr1wz^}p;?Q^s%irQN*U;z#vq1sa z48rrE#Af3`nf#3wOWE&XR)q&kCF<8`A0}6B^AwXHM1)h6QcokI?|%61ikbUr6nZ?|% z(i%37YZPNb6im~e&kls!;H?Nws#C8*YtO!2NS% zg+Rv6f#h~#8a&VTw1Hoa(@ZDBBeiEw5Iad|45%l!4??qTM$c}O?5u&Sg6hv{yw%D(ZO?VGCw9a8c{9?Ou z!#%m70cvQVYBwAv)=pt63v1eO^}2DQ9sfFy`1nGHk*M@IER0?+vcZNeAe~qw9^_eJ z1CgJP6^rz=J-EWHh>e+=<+_l-WGn{@X9Lkhq7t)AXwOFhqgZTm++YI44Q&iOBjUl} zMifnR5&WetG9#lnwKqSL7+MTd3AvLENmq`|L%S8&Ea+_K_8p%c`6G*tDaWqp#*t_a zM2nx`3CGQgS?+*>_@a&5xXKW(9x?B1II`q$PL(2rHj~ikwdf0R=KM=B9b(LF5eZmmJzST5ZrO>IAI1bpA*%w_6~X$%7QEg?q6<&LQ$S zM*EC;pF@DpPu-v8hJ!_m-=!ED0jisXJ>!4K6z11^d6@ER9~l1{=Ke?AZ~*hKq7h^P z=@NWHBO!u=#SpYFBs}1WW)B zDH!OI5)Ehq0#SaPpkNiCVocH)AoMu29x?y|7qGAd*e>0>4|k8NT&ge>4?2&wE0{?^ zvdTov09QEA(HOJ8p_+j-#DlKqxGTUUxEaIma9`z(HCjD!1k(UxU>Lg?v~!BLGo;_y z{$G~??hI(o`;5m&h6}|F8x|I3Mp-$ryx~mv;9%B#5)brB({L(j8r{j#$T(m##2xkp z@q&E;I|l-J9Tr>t+dN~(7+Xl6=(NR7a=7J{c+m5u2w|~M+#=!d)?>LL=foTNUtwLI zQL1-OE0Q?`y4s?{+FU|IUPaARs%K_ObCnOgs&`2(t1IdpFneRF#aNxhV9pppVA%@6 zq}T}p|0bqlMSmTmqXcrQ9M|EgDCsh@MAGE5{op$5xGF762&Mn-b|R%k+N z3m /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' usr/lib/ diff --git a/install_darknet.sh b/install_darknet.sh index b2752203..09235ba1 100755 --- a/install_darknet.sh +++ b/install_darknet.sh @@ -12,7 +12,7 @@ if [ -n "$(ls -A $HOME/darknet/build)" ]; cd darknet mkdir build && cd build cmake -DUSE_GPU=OFF .. - make -j4 + make -j2 sudo make install fi diff --git a/install_opencv.sh b/install_opencv.sh index 97788e2f..99132186 100755 --- a/install_opencv.sh +++ b/install_opencv.sh @@ -12,7 +12,6 @@ if [ -n "$(ls -A $HOME/opencv/build)" ]; mv $HOME/opencv-3.4.2 $HOME/opencv && cd $HOME/opencv mkdir build && cd build cmake -DWITH_GTK=OFF -DWITH_QT=ON .. - make -j4 + make -j2 sudo make install fi -