diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..37e20637 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,62 @@ +language: cpp + +# blacklist +branches: + except: + - master + +# whitelist +branches: + only: + - travis-test + +os: + - linux + - osx + +sudo: required +dist: xenial + +compiler: + - gcc + - clang + +cache: + pip: true + directories: + - $HOME/opencv/ + +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install boost rapidjson glog yaml-cpp qt ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/qt/bin:$PATH" ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install opencv ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget https://www.python.org/ftp/python/2.7.15/python-2.7.15-macosx10.6.pkg ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo installer -pkg python-2.7.15-macosx10.6.pkg -target / ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" ; fi + - 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 + - sudo pip install numpy + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./install_opencv.sh ; fi + +before_script: + - cd DeepLearningSuite + - mkdir build + - cd build + - cmake .. + +script: make -j4 + + +after_success: + - bash ../package.sh + - 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/* + + +branches: + except: + - # Do not build tags that we create when we upload to GitHub Releases + - /^(?i:continuous)$/ diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp index 6548c5a9..7ab90310 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/liveReaders/RecorderReader.cpp @@ -10,6 +10,14 @@ #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) { @@ -89,7 +97,7 @@ bool RecorderReader::getNextSample(Sample &sample) { cv::Mat colorImage= cv::imread(getPathByIndex(this->colorPath,closest(colorIndexes,indexValue),this->syncedData?"-rgb":"")); // if (!this->syncedData) - cv::cvtColor(colorImage,colorImage,CV_RGB2BGR); + cv::cvtColor(colorImage,colorImage,cv::COLOR_RGB2BGR); sample.setColorImage(colorImage); sample.setDepthImage(getPathByIndex(this->depthPath,indexValue,this->syncedData?"-depth":"")); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp index 5d90e5fd..d3a27176 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/PrincetonDatasetReader.cpp @@ -16,6 +16,14 @@ #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; @@ -49,7 +57,7 @@ bool PrincetonDatasetReader::appendDataset(const std::string &datasetPath, const ssDepth << "d-" << depthTimestamp[i] << "-" << depthFrameID[i] << ".png"; std::string depthImagePath = PathHelper::concatPaths(datasetPath, "depth"); depthImagePath = PathHelper::concatPaths(depthImagePath, ssDepth.str()); - cv::Mat depthImage = cv::imread(depthImagePath, CV_LOAD_IMAGE_ANYDEPTH); + cv::Mat depthImage = cv::imread(depthImagePath, cv::IMREAD_ANYDEPTH); cv::Mat ownDepthImage; DepthUtils::mat16_to_ownFormat(depthImage,ownDepthImage); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp index 9f8d7116..b34c5e70 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/DatasetConverters/readers/SpinelloDatasetReader.cpp @@ -11,6 +11,17 @@ #include #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); @@ -60,7 +71,7 @@ bool SpinelloDatasetReader::appendDataset(const std::string &datasetPath, const std::string colorImagePath=datasetPath + "/" + "rgb" + "/" + imageID + ".ppm"; std::string depthImagePath=datasetPath + "/" + "depth" + "/" + imageID + ".pgm"; cv::Mat colorImage= cv::imread(colorImagePath); - cv::Mat depthImage= cv::imread(depthImagePath, CV_LOAD_IMAGE_ANYDEPTH); + cv::Mat depthImage= cv::imread(depthImagePath, cv::IMREAD_ANYDEPTH); cv::Mat ownDepthImage; //DepthUtils::mat16_to_ownFormat(depthImage,ownDepthImage); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.cpp b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.cpp new file mode 100644 index 00000000..e69de29b diff --git a/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h new file mode 100644 index 00000000..100a5da1 --- /dev/null +++ b/DeepLearningSuite/DeepLearningSuiteLib/FrameworkEvaluator/MassBatchInferencer.h @@ -0,0 +1,31 @@ +#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/DetectionsValidator.cpp b/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/DetectionsValidator.cpp index 94242a2a..91303f6b 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/DetectionsValidator.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/GenerationUtils/DetectionsValidator.cpp @@ -55,7 +55,7 @@ void DetectionsValidator::validate(const cv::Mat& colorImage,const cv::Mat& dept for (auto it= detections.begin(), end = detections.end(); it != end; ++it){ int idx= (int)std::distance(detections.begin(),it); cv::Scalar color( 150); - cv::drawContours( mask, detections, idx, color, CV_FILLED, 8); + cv::drawContours( mask, detections, idx, color, -1, 8); } diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Regions/ContourRegions.cpp b/DeepLearningSuite/DeepLearningSuiteLib/Regions/ContourRegions.cpp index 7c681cde..0b381fc7 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/Regions/ContourRegions.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/ContourRegions.cpp @@ -107,7 +107,7 @@ void ContourRegions::drawRegions(cv::Mat &image) { cv::Scalar color(255); std::vector> contours; contours.push_back(it->region); - cv::drawContours(mask, contours, 0, color, CV_FILLED, 8); + cv::drawContours(mask, contours, 0, color, -1, 8); std::vector channels; cv::split(image, channels); cv::Mat colorMask(image.size(), CV_8UC1, cv::Scalar(255)); diff --git a/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h b/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h index f163fc25..740e695e 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/Regions.h @@ -9,6 +9,19 @@ #include #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/DeepLearningSuiteLib/Regions/RleRegions.cpp b/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp index 6fff14bf..def911e2 100644 --- a/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp +++ b/DeepLearningSuite/DeepLearningSuiteLib/Regions/RleRegions.cpp @@ -88,8 +88,7 @@ void RleRegions::drawRegions(cv::Mat &image) { rleDecode(&(it->region), mask.data , 1); mask = mask * 255; - cv::rotate(mask, mask, cv::ROTATE_90_CLOCKWISE); - cv::flip(mask, mask, 1); + cv::Mat rotatedMask = mask.t(); cv::Scalar color; @@ -98,14 +97,14 @@ void RleRegions::drawRegions(cv::Mat &image) { color = cv::Scalar(2,166,101); } else { color = cv::Scalar((unsigned int)(distribution(generator)*170), (unsigned int)(distribution(generator)*170), (unsigned int)(distribution(generator)*170)); - cv::findContours( mask.clone(), contours, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0) ); + cv::findContours( rotatedMask.clone(), contours, cv::RETR_CCOMP, cv::CHAIN_APPROX_SIMPLE, cv::Point(0, 0) ); } cv::Mat colorMask(image.size(), CV_8UC3, color); cv::Mat output(colorMask.size(), CV_8UC3, cv::Scalar(0)); - colorMask.copyTo(output, mask); + colorMask.copyTo(output, rotatedMask); image = image.mul((( 255 - output )/255 )) + output; cv::drawContours(image, contours, -1, color, 2, 8); diff --git a/DeepLearningSuite/Deps/numpy/CMakeLists.txt b/DeepLearningSuite/Deps/numpy/CMakeLists.txt index 5fa96c6c..1665a546 100644 --- a/DeepLearningSuite/Deps/numpy/CMakeLists.txt +++ b/DeepLearningSuite/Deps/numpy/CMakeLists.txt @@ -4,8 +4,8 @@ SET(CMAKE_MODULE_PATH ) -find_package( PythonInterp REQUIRED ) -find_package( PythonLibs REQUIRED ) +find_package( PythonInterp 2.7.12 REQUIRED ) +find_package( PythonLibs 2.7.12 REQUIRED ) find_package( NumPy REQUIRED ) SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${PYTHON_NUMPY_INCLUDE_DIR}) diff --git a/DeepLearningSuite/Deps/opencv/CMakeLists.txt b/DeepLearningSuite/Deps/opencv/CMakeLists.txt index 27b4900d..78087fe6 100644 --- a/DeepLearningSuite/Deps/opencv/CMakeLists.txt +++ b/DeepLearningSuite/Deps/opencv/CMakeLists.txt @@ -1,4 +1,4 @@ -FIND_PACKAGE(OpenCV QUIET) +FIND_PACKAGE(OpenCV) if(OpenCV_FOUND) include(CheckIncludeFileCXX) diff --git a/DeepLearningSuite/Deps/qt/CMakeLists.txt b/DeepLearningSuite/Deps/qt/CMakeLists.txt index a61e4a6d..5d45ef62 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 QUIET) - FIND_PACKAGE(Qt5Gui QUIET) - FIND_PACKAGE(Qt5Svg QUIET) - FIND_PACKAGE(Qt5OpenGL QUIET) + FIND_PACKAGE(Qt5Widgets) + FIND_PACKAGE(Qt5Gui) + FIND_PACKAGE(Qt5Svg) + FIND_PACKAGE(Qt5OpenGL) IF (Qt5Widgets_FOUND AND Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Svg_FOUND AND Qt5OpenGL_FOUND) @@ -26,6 +26,7 @@ IF(ENABLE_QT) ${Qt5OpenGL_LIBRARIES} ) + message(${QT_INCLUDE_DIRS}) SET(QT_FOUND TRUE) ELSE() diff --git a/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp b/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp index f4488d49..c0daaa3e 100644 --- a/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp +++ b/DeepLearningSuite/libs/utils/colorspaces/imagecv.cpp @@ -9,6 +9,29 @@ #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) : name(name), id(id), cvType(cvType),ctor(ctor),cvt(cvt) {} @@ -40,9 +63,9 @@ namespace colorspaces { return ctor(width,height,data); return 0; } - + Image& Image::convert(Image& dst) const throw(NoConversion){ - //std::cerr << "colorspaces: imagecv: convert: " << *_format << "->" << *dst._format << std::endl; + //std::cerr << "colorspaces: imagecv: convert: " << *_format << "->" << *dst._format << std::endl; return _format->cvt(*this,dst); } @@ -50,7 +73,7 @@ namespace colorspaces { Image copy(cv::Mat::clone(),_format); return copy; } - + //static definitions const Image::FormatPtr Image::FORMAT_NONE = Image::Format::createFormat("NONE",0,0,0); @@ -84,7 +107,7 @@ namespace colorspaces { ImageRGB8::ImageRGB8(const int width, const int height) : Image(width,height,FORMAT_RGB8) {} - + ImageRGB8::ImageRGB8(const int width, const int height, void *const data) : Image(width,height,FORMAT_RGB8,data) {} @@ -98,13 +121,13 @@ namespace colorspaces { if (stat(filename.c_str(),&s) == -1) throw std::runtime_error(filename+" not found"); cv::Mat readImage(cv::imread(filename));//BGR - cv::cvtColor(readImage,readImage,CV_BGR2RGB); + cv::cvtColor(readImage,readImage,cv::COLOR_BGR2RGB); return ImageRGB8(Image(readImage,FORMAT_RGB8)); } bool ImageRGB8::write(const std::string& filename,const std::vector& params){ cv::Mat bgrImage(this->size(),this->type()); - cv::cvtColor(*this,bgrImage,CV_RGB2BGR); + cv::cvtColor(*this,bgrImage,cv::COLOR_RGB2BGR); return cv::imwrite(filename, bgrImage, params); } @@ -134,7 +157,7 @@ namespace colorspaces { void ImageRGB8::toGRAY8(Image& dst) const throw(Image::FormatMismatch){ if (dst.format() != ImageGRAY8::FORMAT_GRAY8) throw Image::FormatMismatch("FORMAT_GRAY8 required for dst"); - cv::cvtColor(*this,dst,CV_RGB2GRAY); + cv::cvtColor(*this,dst,cv::COLOR_RGB2GRAY); } void ImageRGB8::toYUY2(Image& dst) const throw(Image::FormatMismatch){ @@ -145,7 +168,7 @@ namespace colorspaces { cv::Mat_ ycrcb(dst.height,dst.width,dst.type());//YUV444 previous conversion cv::Mat_ yuy2(dst); - cv::cvtColor(*this,ycrcb,CV_RGB2YCrCb); + cv::cvtColor(*this,ycrcb,cv::COLOR_RGB2YCrCb); for (int i=0; i < height; i++){ for (int j=0; j < width; j+=2){//two pixels each loop @@ -160,13 +183,13 @@ namespace colorspaces { void ImageRGB8::toHSV8(Image& dst) const throw(FormatMismatch){ if (dst.format() != ImageHSV8::FORMAT_HSV8) throw Image::FormatMismatch("FORMAT_HSV8 required for dst"); - cv::cvtColor(*this,dst,CV_RGB2HSV); + cv::cvtColor(*this,dst,cv::COLOR_RGB2HSV); } void ImageRGB8::toYCRCB(Image& dst) const throw(FormatMismatch){ if (dst.format() != ImageYCRCB::FORMAT_YCRCB) throw Image::FormatMismatch("FORMAT_YCRCB required for dst"); - cv::cvtColor(*this,dst,CV_RGB2YCrCb); + cv::cvtColor(*this,dst,cv::COLOR_RGB2YCrCb); } Image* ImageRGB8::createInstance(const int width, const int height, void *const data){ @@ -178,7 +201,7 @@ namespace colorspaces { ImageYUY2::ImageYUY2(const int width, const int height) : Image(width,height,FORMAT_YUY2) {} - + ImageYUY2::ImageYUY2(const int width, const int height, void *const data) : Image(width,height,FORMAT_YUY2,data) {} @@ -221,8 +244,8 @@ namespace colorspaces { ImageYCRCB ycrcbImg(dst.height,dst.width);//YCRCB previous conversion toYCRCB(ycrcbImg); - - cv::cvtColor(ycrcbImg,dst,CV_YCrCb2RGB); + + cv::cvtColor(ycrcbImg,dst,cv::COLOR_YCrCb2RGB); } void ImageYUY2::toYCRCB(Image& dst) const throw(FormatMismatch){ @@ -249,10 +272,10 @@ namespace colorspaces { else return new ImageYUY2(width,height); } - + ImageGRAY8::ImageGRAY8(const int width, const int height) : Image(width,height,FORMAT_GRAY8) {} - + ImageGRAY8::ImageGRAY8(const int width, const int height, void *const data) : Image(width,height,FORMAT_GRAY8,data) {} @@ -292,7 +315,7 @@ namespace colorspaces { if (dst.format() != ImageRGB8::FORMAT_RGB8) throw Image::FormatMismatch("FORMAT_RGB8 required for dst"); - cv::cvtColor(*this,dst,CV_GRAY2RGB); + cv::cvtColor(*this,dst,cv::COLOR_GRAY2RGB); } void ImageGRAY8::toYUY2(Image& dst) const throw(Image::FormatMismatch){ @@ -316,7 +339,7 @@ namespace colorspaces { ImageHSV8::ImageHSV8(const int width, const int height) : Image(width,height,FORMAT_HSV8) {} - + ImageHSV8::ImageHSV8(const int width, const int height, void *const data) : Image(width,height,FORMAT_HSV8,data) {} @@ -343,7 +366,7 @@ namespace colorspaces { if (dst.format() != ImageRGB8::FORMAT_RGB8) throw Image::FormatMismatch("FORMAT_RGB8 required for dst"); - cv::cvtColor(*this,dst,CV_HSV2RGB); + cv::cvtColor(*this,dst,cv::COLOR_HSV2RGB); } Image* ImageHSV8::createInstance(const int width, const int height, void *const data){ @@ -355,7 +378,7 @@ namespace colorspaces { ImageYCRCB::ImageYCRCB(const int width, const int height) : Image(width,height,FORMAT_YCRCB) {} - + ImageYCRCB::ImageYCRCB(const int width, const int height, void *const data) : Image(width,height,FORMAT_YCRCB,data) {} @@ -381,8 +404,8 @@ namespace colorspaces { void ImageYCRCB::toRGB8(Image& dst) const throw(FormatMismatch){ if (dst.format() != ImageRGB8::FORMAT_RGB8) throw Image::FormatMismatch("FORMAT_RGB8 required for dst"); - - cv::cvtColor(*this,dst,CV_YCrCb2RGB); + + cv::cvtColor(*this,dst,cv::COLOR_YCrCb2RGB); } Image* ImageYCRCB::createInstance(const int width, const int height, void *const data){ @@ -394,7 +417,7 @@ namespace colorspaces { ImageNV21::ImageNV21(const int width, const int height) : Image(width,height,FORMAT_NV21) {} - + ImageNV21::ImageNV21(const int width, const int height, void *const data) : Image(width,height,FORMAT_NV21,data) {} @@ -435,8 +458,8 @@ namespace colorspaces { if ((dst.width % 2 != 0) || (this->width % 2 != 0)) throw Image::FormatMismatch("src and dst images have to have even number of columns"); - //cv::cvtColor(*this,dst,CV_YUV420sp2RGB); - + //cv::cvtColor(*this,dst,cv::COLOR_YUV420sp2RGB); + unsigned char *rgb = (unsigned char *)dst.data; unsigned char *yuv = (unsigned char *)this->data, *yuv_y = yuv, *yuv_uv = yuv + dst.width * dst.height; @@ -464,7 +487,7 @@ namespace colorspaces { throw Image::FormatMismatch("FORMAT_YCRCB required for dst"); ImageYCRCB rgbImg(dst.height,dst.width); toRGB8(rgbImg); - cv::cvtColor(rgbImg,dst,CV_RGB2YCrCb); + cv::cvtColor(rgbImg,dst,cv::COLOR_RGB2YCrCb); } Image* ImageNV21::createInstance(const int width, const int height, void *const data){ diff --git a/DeepLearningSuite/package.sh b/DeepLearningSuite/package.sh new file mode 100644 index 00000000..5d44cb86 --- /dev/null +++ b/DeepLearningSuite/package.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +######################################################################## +# Package the binaries built on Travis-CI as an AppImage +# By Simon Peter 2016 +# For more information, see http://appimage.org/ +######################################################################## + +export ARCH=$(arch) + +APP=DetectionSuite +LOWERAPP=${APP,,} + + +mkdir -p $APP.AppDir/usr/ +wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh +. ./functions.sh + +cd $APP.AppDir + +echo `pwd` + +mkdir -p usr/bin +cp ../DatasetEvaluationApp/DatasetEvaluationApp usr/bin/ + +mkdir -p usr/lib +ldd ../DatasetEvaluationApp/DatasetEvaluationApp | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' usr/lib/ + +echo "Now copying Qt plugin libraries" +mkdir usr/bin/platforms/ + +# For Qt Dependency +cp -v `find /usr -iname 'libqxcb.so'` usr/bin/platforms + +find /usr -iname 'libqxcb.so' | xargs ldd | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' usr/bin/platforms + +# Copying necessary python modules +cp -v -r ../../DeepLearningSuiteLib/python_modules usr/lib/ + +cd usr/ ; find . -type f -exec sed -i -e 's|/usr|././|g' {} \; ; cd - + +cat > AppRun << 'EOF' +#!/usr/bin/env bash +# some magic to find out the real location of this script dealing with symlinks +DIR=`readlink "$0"` || DIR="$0"; +DIR=`dirname "$DIR"`; +cd "$DIR" +DIR=`pwd` +cd - > /dev/null +# disable parameter expansion to forward all arguments unprocessed to the VM +set -f +# run the VM and pass along all arguments as is +export PYTHONPATH="$DIR/usr/lib/python_modules" +LD_LIBRARY_PATH="$DIR/usr/lib" "${DIR}/usr/bin/DatasetEvaluationApp" "$@" +EOF + +chmod +x AppRun + +wget http://files.pharo.org/media/logo/icon-lighthouse-512x512.png -O $APP.png + +cat > $APP.desktop <