Comments (18)
The latest tree (specifically, the commit bb33fb5) adds more capabilities to the Arapaho test wrapper. Please check !!! Thanks.
from darknet.
I need some more feedback on the API (in the header file) for the usage, before I can term it complete. Any inputs ?
from darknet.
After getting some more feedback on the API, I have updated the code significantly, and it mostly runs, but I have not checked validity of bounding boxes yet. Please see the latest commit tag 3.77,
https://github.com/prabindh/darknet/blob/v3.77/arapaho/test.cpp.
To build arapaho (use latest tag 3.77), just use below command, till I finish the rest of the changes. The GPU/CUDNN flags need to match the build flags for darknet-cpp-shared.
g++ test.cpp arapaho.cpp -DGPU -DCUDNN -I../src/ -I/usr/local/cuda/include/ -L./ -ldarknet-cpp-shared -L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_shape -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_calib3d -lopencv_features2d -lopencv_objdetect -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudawarping -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_video -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_cudaarithm -lopencv_viz -lopencv_core -lopencv_cudev -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -std=c++11
from darknet.
Hi @prabindh
I compiled it by the following as you mentioned above:
g++ test.cpp arapaho.cpp -DGPU -DCUDNN -I../src/ -I/usr/local/cuda/include/ -L../ -ldarknet-cpp-shared -L/usr/local/lib -lopencv_core -lopencv_highgui -I/your cudnn/include -L/your cudnn/cuda/lib64 -lcudnn -std=c++11
from darknet.
Build and run with following command (without cudnn):
g++ test.cpp arapaho.cpp -DGPU -I../src/ -I/usr/local/cuda/include/ -L../ -ldarknet-cpp-shared -L/usr/local/lib -lopencv_core -lopencv_highgui -std=c++11
LD_LIBRARY_PATH=..
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH export PATH=/usr/local/cuda-8.0/bin:$PATH
Tomorrow I will try to visualize the result of detection.
from darknet.
Were you able to visualize the result ?
from darknet.
I have updated the code to use maximum classes correctly. Please use latest tree.
from darknet.
Announcement: Tag https://github.com/prabindh/darknet/tree/v4.01 is now released, with further compile fixes for Mac and windows, and Arapaho readme. For windows builds please use https://github.com/prabindh/darknet-cpp-windows
from darknet.
` using ObjTraits = std::pair<int, cv::Rect>;
std::vector ArapahoV2::getObjTraits()
{
int count = 0;
mObjTraits.resize(mNumOfDetectedObj);
for(int i = 0; i < (l.wl.hl.n); ++i)
{
int class1 = max_index(probs[i], l.classes);
float prob = probs[i][class1];
if(prob > threshold && count < mNumOfDetectedObj)
{
cv::Rect rect(
(boxes[i].x - boxes[i].w / 2)mImg.size().width,
(boxes[i].y - boxes[i].h / 2)mImg.size().height,
boxes[i].wmImg.size().width,
boxes[i].hmImg.size().height);
mObjTraits[count++] = std::make_pair(class1,rect);
}
}
return mObjTraits;
}
int ArapahoV2::detect(cv::Mat inImg)
{
ArapahoImageBuff imageBuff;
imageBuff.bgr = inImg.data;
imageBuff.w = inImg.size().width;
imageBuff.h = inImg.size().height;
imageBuff.channels = 3;
mImg = inImg;
int numObjects{0};
this->Detect(imageBuff,0.24,0.5,numObjects);
return numObjects;
}
void ArapahoV2::drawResult(cv::Mat img, std::vector traits)
{
for(auto iter = traits.begin(); iter != traits.end(); ++iter)
{
cv::rectangle(img,iter->second,
cv::Scalar(0,255,0),3);
std::string str = std::to_string(iter->first);
cv::putText(img,str,
cv::Point(iter->second.x, iter->second.y),
cv::FONT_HERSHEY_SCRIPT_SIMPLEX,
2,
cv::Scalar(0,255,0),3);
}
} `
from darknet.
Would you be submitting a patch for this, or do you want me to integrate this after testing ? Thanks !!
from darknet.
I think it wil be better if you integrate it by yourself
from darknet.
Ok will do, could you please update results of any testing with OpenCV with this code ? Thx
from darknet.
I'm no @D3Nd3R obviously, but I just wanted to say your bb33fb5 commit has been great, drawing red boxes on my OpenCV windows. Thank you Prabindh!
from darknet.
@Efreeto Please check latest master, it also adds drawing labels in addition to the rects. Thanks for the encouraging words.
from darknet.
It also works well Prabindh 👍
I just had the need for this actually. Thank you for this Prabindh and Liang!
from darknet.
thanks for your C++ wrapper I run make command firstly in darknet
folder It get build their but when I am running make arapaho
,it is giving me following error.
vishal@user756:~/Desktop/darknet/arapaho$ make arapaho
rm -rf ./arapaho.out
g++ test.cpp arapaho.cpp -D_DEBUG -I../src/ -I/usr/local/cuda/include/ -L./ -ldarknet-cpp-shared -L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_shape -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_calib3d -lopencv_features2d -lopencv_objdetect -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudawarping -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_video -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_cudaarithm -lopencv_viz -lopencv_core -lopencv_cudev -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -std=c++11 -o arapaho.out
/usr/bin/ld: cannot find -lopencv_cudabgsegm
/usr/bin/ld: cannot find -lopencv_cudaobjdetect
/usr/bin/ld: cannot find -lopencv_cudastereo
/usr/bin/ld: cannot find -lopencv_shape
/usr/bin/ld: cannot find -lopencv_cudafeatures2d
/usr/bin/ld: cannot find -lopencv_cudacodec
/usr/bin/ld: cannot find -lopencv_cudaoptflow
/usr/bin/ld: cannot find -lopencv_cudalegacy
/usr/bin/ld: cannot find -lopencv_videoio
/usr/bin/ld: cannot find -lopencv_imgcodecs
/usr/bin/ld: cannot find -lopencv_cudawarping
/usr/bin/ld: cannot find -lopencv_cudaimgproc
/usr/bin/ld: cannot find -lopencv_cudafilters
/usr/bin/ld: cannot find -lopencv_cudaarithm
/usr/bin/ld: cannot find -lopencv_viz
/usr/bin/ld: cannot find -lopencv_cudev
collect2: error: ld returned 1 exit status
make: *** [arapaho] Error 1
Please tell me how to resolve it.
from darknet.
Ok I got the solution I just removed these libraries from Makefile
and now my Makefile
is this.
# Makefile to build the test-wrapper for Arapaho
# Undefine GPU, CUDNN if darknet was built without these defined. These 2 flags have to match darknet flags.
# https://github.com/prabindh/darknet #add -DGPU -DCUDNN after arapaho.cpp and before -D_DEBUG
arapaho: clean
g++ test.cpp arapaho.cpp -D_DEBUG -I../src/ -I/usr/local/cuda/include/ -L./ -ldarknet-cpp-shared -L/usr/local/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_objdetect -lopencv_highgui -lopencv_photo -lopencv_video -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -std=c++11 -o arapaho.out
clean:
rm -rf ./arapaho.out
I also removed `-DGPU -DCUDNN` these as, my system do not have those.
from darknet.
@vg123 yes, if you do not need OpenCV support (for scaling it is faster) for scaling/rendering, you can remove those. Also remove from darknet build (OPENCV=0).
from darknet.
Related Issues (20)
- Arapaho stream with camera HOT 4
- input.data HOT 2
- Yolo v3 is out, sync with the original code? HOT 3
- 0 prediction with arapaho build (Yolo V3) HOT 2
- upsample_cpu is not defined when GPU=0 HOT 2
- Video of type 8UC1 is not working HOT 9
- After 10 Minutes Arapaho program getting killed HOT 15
- Cuda 9 HOT 6
- darknet-cpp compilation failed on Ubuntu 16.04 HOT 6
- Memory corruption of Arapaho from a library HOT 4
- Cmake compile problem HOT 6
- Differences scores between Darknet and Arapaho HOT 5
- When the width and height of the input picture are not equal, the output box will shift on windows
- Add OpenCV 4.x support HOT 27
- Arapaho build issue HOT 3
- libv4l2: error getting capabilities: Inappropriate ioctl for device HOT 5
- Darknet saved weights are not giving outputs in this HOT 2
- Anyone tested darknet-cpp on Cuda 6.5 (Ubuntu 14.04)? HOT 5
- Trained in two classes the object can't be inference HOT 3
- error "identifier \"ipl_to_image\" is undefined","LineNumber": 234, File: arapaho.cpp HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from darknet.