Giter Site home page Giter Site logo

kleinyuan / easy-yolo Goto Github PK

View Code? Open in Web Editor NEW
99.0 99.0 27.0 70.36 MB

Yolo (Real time object detection) model training tutorial with deep learning neural networks

License: Other

Makefile 0.32% Python 0.39% Cuda 7.97% C 91.01% C++ 0.31%
camera darknet deep-learning deep-learning-tutorial labelimg machine-learning multiple-gpu object-detection python real-time training-yolo tutorial yolo

easy-yolo's People

Contributors

kleinyuan avatar mdsheerazaziz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easy-yolo's Issues

how can I test video file ?

I want to test the video file.
Can I only test live stream cameras?
If so, can you tell me more about how to use stream cameras?

cuda_runtime.h : No such file or directory

Hello
my machine and environment is
8 CPU
Quadro M4000 GPU
30 GB RAM
50 GB SSD
Ubuntu 14.04
OpenCV v2.4.8
CUDA 8.0.61-1
cuDNN 5.1.10-1+cuda8.0

and When I try to create a darknet executable (step 5.b) ,
kakaotalk_20180104_010757053

there is some error : cuda_runtime.h : No such file or directory

what is the problem? I really need your help...

Display label correctly

I want to display the label in my box.
However, it is displayed in black.
How can I display it?
What files or folders should I change?

1 2

Calculation of PR curve

How to calculate PR curve for testing folder. I have added some code in detector.c to calculate the value but it's not working

void validate_detector_PRcurve(char *datacfg, char *cfgfile, char *weightfile)
{
list *options = read_data_cfg(datacfg);
char *valid_images = option_find_str(options, "valid", "data/voc.2007.test");

network net = parse_network_cfg(cfgfile);
if(weightfile){
    load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
fprintf(stderr, "Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay);
srand(time(0));

list *plist = get_paths("/home/deepshikha/Desktop/easy-yolo/text1.txt");
char **paths = (char **)list_to_array(plist);

layer l = net.layers[net.n-1];
int classes = l.classes;

int j, k;
box *boxes = calloc(l.w*l.h*l.n, sizeof(box));
float **probs = calloc(l.w*l.h*l.n, sizeof(float *));
for(j = 0; j < l.w*l.h*l.n; ++j) probs[j] = calloc(classes+1, sizeof(float *));

int m = plist->size;
int i=0;

float iou_thresh = .5;
float nms = .4;

for(float thresh = 0; thresh < 1; thresh = thresh + 0.01){	
int total = 0;
    int TP = 0, FP = 0;
    int proposals = 0;
	float avg_iou = 0;	
for(i = 0; i < m; ++i){
	char *path = paths[i];
	image orig = load_image_color(path, 0, 0);
	image sized = resize_image(orig, net.w, net.h);
	char *id = basecfg(path);
	network_predict(net, sized.data);
	get_region_boxes(l, sized.w, sized.h, net.w, net.h, thresh, probs, boxes, 1, 0, .5, 1);
	if (nms) do_nms(boxes, probs, l.w*l.h*l.n, 1, nms);

	char labelpath[4096];
	find_replace(path, "images", "labels", labelpath);
	find_replace(labelpath, "JPEGImages", "labels", labelpath);
	find_replace(labelpath, ".png", ".txt", labelpath);
	find_replace(labelpath, ".jpg", ".txt", labelpath);
	find_replace(labelpath, ".JPEG", ".txt", labelpath);

	int num_labels = 0;
	box_label *truth = read_boxes(labelpath, &num_labels);
	for(k = 0; k < l.w*l.h*l.n; ++k){
	    if(probs[k][0] > thresh){
		++proposals;
	    }
	}
	for (j = 0; j < num_labels; ++j) {
	    ++total;
	    box t = {truth[j].x, truth[j].y, truth[j].w, truth[j].h};
	    float best_iou = 0;
	    for(k = 0; k < l.w*l.h*l.n; ++k){
		float iou = box_iou(boxes[k], t);
		if(probs[k][0] > thresh && iou > best_iou){
		    best_iou = iou;
		}
	    }
	    avg_iou += best_iou;
	    if(best_iou > iou_thresh){
		++TP;
	    }
	}
	FP = proposals - TP;

	free(id);
	free_image(orig);
	free_image(sized);
}
fprintf(stderr, "Thresh:%.4f\tRecall:%.2f%%\tPrecision:%.2f%%\n", thresh, 100.*TP/total, 100.*TP/(TP+FP));
}

}

Testing on folder

How to use test command for a test folder instead of single image and save the results along with number of bounding box?

Segmentation fault (Core dumped)

I am getting This error After running make train. I have created the folder according to as it is described . My Images are in .JPG format and verying size.

Does we Require to change anything in src folder as it is not mentioned here to make a change I am curious since yolo.c took no of class and class name and annotation path If these are needed to change. Or because of that error is occuring

pythonwrapper fix

line6 in easy-yolo/pythonWrapper.py should read
output = proc.stdout.readline()

not
output = proc.stdout.read()

(1) Incorrect location: Image/.txt (2) in_place.py not working

Hello,
This is a great project and I enjoy training now with my custom jpg images (Ubuntu14.04, GTX1080Ti). I report two minor errors and eventually run successfully.

1: When I did "make train", there was an error message like, 'there is no file in ./Images/1.txt'. Of course, there is no 1.txt in the Images folder, because these are created in the devkit/2017/Labels. I copy/pasted these .txt files to the Images folder. That was enough to run successfully. The script needs to change to look for the label (.txt) files in the Labels, not in the Images folder.

2: scripts/in_place.py did not work to me. I simply found the respective parts in the easy.cfg and easy.data manually.

3: Regarding the testing a static image, it was a bit harder to solve! I wanted a jpg image to test, but it was designated as png. I looked into scripts and changed as follows:
(a) in pythonWrapper.py
fp = "test.jpg"
#fp = "test.png"
(b) in Makefile at the end,
test: ${PWD}/darknet detector test cfg/easy.data cfg/easy.cfg ${PWD}/backup/easy_final.weights ${PWD}/test.jpg
#test:${PWD}/darknet detector test cfg/easy.data cfg/easy.cfg ${PWD}/backup/easy_final.weights ${PWD}/test.png

Then, 'make train' yielded a jpg image with a predicted bounding box. However, I was puzzled with long error massages like:
Cannot load image "data/labels/32_0.png"
Cannot load image "data/labels/33_0.png"
I have two questions on this error. First, I cannot find a 'data' folder. Where is it? Second, how can I fix to reflect my training on jpg images?

Thank you!!

OpenCV Error : Configuration incomplete

I have followed your instructions up until the cmake -G Makefiles... command and got the following error:

CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any
  of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:487 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
  By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Gui", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Gui" with any
  of the following names:

    Qt5GuiConfig.cmake
    qt5gui-config.cmake

  Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
  "Qt5Gui_DIR" to a directory containing one of the above files.  If "Qt5Gui"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:487 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
  By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5Widgets", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Widgets" with
  any of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

  Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
  "Qt5Widgets_DIR" to a directory containing one of the above files.  If
  "Qt5Widgets" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:487 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
  By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Test", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Test" with any
  of the following names:

    Qt5TestConfig.cmake
    qt5test-config.cmake

  Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set
  "Qt5Test_DIR" to a directory containing one of the above files.  If
  "Qt5Test" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:487 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
  By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5Concurrent", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Concurrent"
  with any of the following names:

    Qt5ConcurrentConfig.cmake
    qt5concurrent-config.cmake

  Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set
  "Qt5Concurrent_DIR" to a directory containing one of the above files.  If
  "Qt5Concurrent" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:487 (include)


qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
CMake Error at /usr/share/cmake-3.5/Modules/FindQt4.cmake:1326 (message):
  Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
  cmake/OpenCVFindLibsGUI.cmake:34 (find_package)
  CMakeLists.txt:487 (include)


-- Configuring incomplete, errors occurred!
See also "/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeOutput.log".
See also "/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeError.log".

[edit]

CMakeError.log

Determining if the system is big endian passed with the following output:
Change Dir: /home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_67d3e/fast"
/usr/bin/make -f CMakeFiles/cmTC_67d3e.dir/build.make CMakeFiles/cmTC_67d3e.dir/build
make[1]: Entering directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_67d3e.dir/TestEndianess.c.o
/usr/bin/cc    -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -ffunction-sections  -O3 -DNDEBUG   -o CMakeFiles/cmTC_67d3e.dir/TestEndianess.c.o   -c /home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp/TestEndianess.c
Linking C executable cmTC_67d3e
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_67d3e.dir/link.txt --verbose=1
/usr/bin/cc   -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -ffunction-sections  -O3 -DNDEBUG    CMakeFiles/cmTC_67d3e.dir/TestEndianess.c.o  -o cmTC_67d3e -rdynamic 
make[1]: Leaving directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'

TestEndianess.c:
/* A 16 bit integer is required. */
typedef unsigned short cmakeint16;

/* On a little endian machine, these 16bit ints will give "THIS IS LITTLE ENDIAN."
   On a big endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_little[] =  {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x5454, 0x454c, 0x4520, 0x444e, 0x4149, 0x2e4e, 0x0000};

/* on a big endian machine, these 16bit ints will give "THIS IS BIG ENDIAN."
   On a little endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_big[] =     {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};

#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
  int require = 0;
  require += info_little[argc];
  require += info_big[argc];
  (void)argv;
  return require;
}


Determining if the include file io.h exists failed with the following output:
Change Dir: /home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2e298/fast"
/usr/bin/make -f CMakeFiles/cmTC_2e298.dir/build.make CMakeFiles/cmTC_2e298.dir/build
make[1]: Entering directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2e298.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -ffunction-sections  -O3 -DNDEBUG   -o CMakeFiles/cmTC_2e298.dir/CheckIncludeFile.c.o   -c /home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:16: fatal error: io.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_2e298.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_2e298.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_2e298.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_2e298/fast' failed
make: *** [cmTC_2e298/fast] Error 2


Determining if the function jbg_newlen exists failed with the following output:
Change Dir: /home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_36db2/fast"
/usr/bin/make -f CMakeFiles/cmTC_36db2.dir/build.make CMakeFiles/cmTC_36db2.dir/build
make[1]: Entering directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_36db2.dir/CheckFunctionExists.c.o
/usr/bin/cc    -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -ffunction-sections -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG   -o CMakeFiles/cmTC_36db2.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
/usr/share/cmake-3.5/Modules/CheckFunctionExists.c:6:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 char CHECK_FUNCTION_EXISTS();
 ^
Linking C executable cmTC_36db2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_36db2.dir/link.txt --verbose=1
/usr/bin/cc   -fPIC   -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -Wno-array-bounds -Wno-aggressive-loop-optimizations -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -msse -msse2 -msse3 -ffunction-sections -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG    CMakeFiles/cmTC_36db2.dir/CheckFunctionExists.c.o  -o cmTC_36db2 -rdynamic 
CMakeFiles/cmTC_36db2.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text.startup.main+0xe): undefined reference to `jbg_newlen'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_36db2.dir/build.make:97: recipe for target 'cmTC_36db2' failed
make[1]: *** [cmTC_36db2] Error 1
make[1]: Leaving directory '/home/nukadelic/opencv-2.4.13/release/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_36db2/fast' failed
make: *** [cmTC_36db2/fast] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.