Training Haar cascade object detection - OpenCV with Python for Image and Video Analysis 20

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ม.ค. 2025

ความคิดเห็น • 256

  • @edmondcasenas2565
    @edmondcasenas2565 5 ปีที่แล้ว

    thank you very much, without this tutorial it will be hard for me to gather valuable resources :D

  • @dwang2805
    @dwang2805 5 ปีที่แล้ว

    Five minutes ago I searched a machine learning video, it's you.
    Now, I found this video on the internet, it's you again....

  • @jibrilqarni
    @jibrilqarni 8 ปีที่แล้ว +1

    dude, you know what? you're just awesome !

  • @YOLO-gb5ie
    @YOLO-gb5ie 8 ปีที่แล้ว +13

    If you got the error message "Invalid background description file" when creating samples, just open bg.txt file and delete any empty lines at the bottom. ;)

    • @vaibhavrai5360
      @vaibhavrai5360 7 ปีที่แล้ว

      can i train samples with my own laptop cpu ????or its like important to use VPS to train??

    • @epicwebvideos
      @epicwebvideos 7 ปีที่แล้ว

      You can train with laptop cpu but it will take a long time

    • @vaibhavrai5360
      @vaibhavrai5360 7 ปีที่แล้ว

      thanks @Truth Seeker

  • @lumierevr7473
    @lumierevr7473 8 ปีที่แล้ว +4

    my info.lst instead of getting the path to image with positive, I got a txt files in a directory named annotation. Any idea why ?

  • @bryangarcia4153
    @bryangarcia4153 7 ปีที่แล้ว +4

    What''s the point of getting a server if your computer has better specs? By the time your server was done with stage one I was on stage 6 and my computer is not even fast (it took me 8 mins and 26 seconds ) so I don't see the benefit of the server

    • @Max24871
      @Max24871 7 ปีที่แล้ว

      The cheaper servers are really underpowered. I have no idea why he is doing that either

    • @vinodpatil9474
      @vinodpatil9474 7 ปีที่แล้ว

      in ubutu is it work

  • @sanjayastn
    @sanjayastn 8 ปีที่แล้ว +4

    I need help..All things went right but when I execute the command opencv_createsamples it throws me an error saying "Invalid background description file".I have tried several times creating new bg.txt but gives me the same error.And also it shows me outputs same as yours and after "Create samples from single image applying distortions" it outputs as follows,
    open background image : neg/1.jpg
    open background image : neg/1210.jpg
    ..
    ..
    ..
    (After list of these at last it gives me the above error)
    what is the wrong I have done?please help :(

    • @geraldoneto123
      @geraldoneto123 8 ปีที่แล้ว

      Same here !

    • @leonchen4609
      @leonchen4609 8 ปีที่แล้ว

      Hey Sanjaya, it may be the default language which you open a txt file is not English (I encounter the same issue and figured out it's due to my computer is in Chinese default). A quick fix is to hand type the first line of bg.txt (neg/123.jpg) to bg2.txt and then paste the rest of bg.txt to bg2.txt.

    • @vaibhavrai5360
      @vaibhavrai5360 7 ปีที่แล้ว

      can i train samples with my own laptop cpu ????or its like important to use VPS to train and there will be same commands that he uses for tarin or any changes required??

    • @tuyenvokhac7943
      @tuyenvokhac7943 7 ปีที่แล้ว

      thank you, Leon Chen.

  • @Sarah7asan
    @Sarah7asan 7 ปีที่แล้ว +1

    This is really a great tutorial... thanx a lot
    Is it possible to do the same steps with some videos?

  • @muhammadabraranwar7600
    @muhammadabraranwar7600 8 ปีที่แล้ว +6

    You are star mate.
    Just a quick one, how I can use multiple images for a same object and create info.lst file using multiple images.For example, in this case we used watch5050.jpg how about, if i also have watch5051.jpg, watch5052.jpg.
    look forward to hearing from you soon.

    • @DSHYtv
      @DSHYtv 6 ปีที่แล้ว

      well, you can make images separate, example: first > you create samples for watch5051.jpg, later make for others images watch5052, watch5053, watch5054....
      now you create the vec file for all samples (all separateded, one to one), later you move all .vec files for a unique folder and run the script 'mergevec.py' (have on github), and now, you can trainning with all images.
      well, is laborious but work

  • @nuwan78
    @nuwan78 8 ปีที่แล้ว +2

    Hi , i fixed the google server but now i get " Invalid background description file" error and info.lst file is created in info directory. why? , Should i try with different set of negatives

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว +2

      cause for my problem is creating bg.txt file in Windows machine and using it in a linux vertual server.create your bg.txt file in same server using python

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว +1

      your linux instant in comes with python pre installed

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว +1

      upload python script to server and type "python scriptname.py"(make sure your in the same location of the script)

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว +1

      Did you exicute the python script which output the bg.txt file in the same server

    • @leonchen4609
      @leonchen4609 8 ปีที่แล้ว +3

      Hey nuwan78, it may be the default language which you open a txt file is not English (I encounter the same issue and figured out it's due to my computer is in Chinese default). A quick fix is to hand type the first line of bg.txt (neg/123.jpg) to bg2.txt and then paste the rest of bg.txt to bg2.txt.

  • @sonhiya
    @sonhiya 6 ปีที่แล้ว +2

    I have done the same but it shows
    ****Error in opencv_createsamples : corrupted size vs. prev_size: 0x00bfc850 ****

  • @traviswu1485
    @traviswu1485 8 ปีที่แล้ว +2

    I keep getting
    info.lst(1) : parse errorDone. Created 0 samples
    when I try to create the vec file
    I try manipulating the -num tag or even dropping it all together but to no avail. Any idea why this might be ?

    • @sasukeuchiha-bt9nf
      @sasukeuchiha-bt9nf 8 ปีที่แล้ว

      yo tengo ese error, no se porque pasa eso. @sentdex

    • @milonfinfa
      @milonfinfa 8 ปีที่แล้ว

      I've got the same issue. :-(

    • @TheSoundGrid.
      @TheSoundGrid. 7 ปีที่แล้ว

      I have got the same issue

    • @TheSoundGrid.
      @TheSoundGrid. 7 ปีที่แล้ว

      I found the solution - change the pngoutput to jpgoutput "opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst -jpgoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950"
      -- As we are passing the jpg for watch5050. Dont know if that is an typo made by sentdex. but it works for me.

  • @alexn2566
    @alexn2566 7 ปีที่แล้ว

    Absolutely phenomenal tutorial ! Thank you very much. I still have two questions tough:
    1. Making the positive images bigger (like 50x50) would help accuracy?
    2. The positive object superimposed on negatives is quite big (compared to how it should be in a real photo) will this affect accuracy? Also the object I am training for has very few details at such a size (50x50) (it is moastly a square of the same color) will it help use a bigger positive image to preserve some details in it?

  • @djmattc1978
    @djmattc1978 7 ปีที่แล้ว

    Excellent video. I'm after a cascade of vehicle wheels so I can detect cars passing by my house. I thought this would be quite popular but I can't seem to find one to download. Is this a cascade you've ever come across? If not, I will go about following these videos again and hopefully create my own.

  • @Spasmomen
    @Spasmomen 4 ปีที่แล้ว

    0:30 how do you cd into that directory without fully typing it?

  • @247biker
    @247biker 7 ปีที่แล้ว +4

    i get an error that says segmentation fault(core dumped), can anyone tell me what it means and how to solve it?

    • @neelbhalla1710
      @neelbhalla1710 7 ปีที่แล้ว

      That is a very vague error, most likely means that you ran out of resources

    • @kidistabraham1528
      @kidistabraham1528 7 ปีที่แล้ว

      Hey did you find the solution? I am struggling with the same problem

    • @basmamohammed1605
      @basmamohammed1605 7 ปีที่แล้ว

      if you have found the solution, please, write it here

    • @basmamohammed1605
      @basmamohammed1605 7 ปีที่แล้ว

      what do you mean by ran out of resources?

    • @basmamohammed1605
      @basmamohammed1605 7 ปีที่แล้ว

      Josue Castillo ?

  • @SogMosee
    @SogMosee 8 ปีที่แล้ว +1

    So you once mentioned that in college you majored in Criminology and one other degree that I cannot remember. The really interesting thing here is that you have no formal education in computer science. My question is did you begin learning computer science while you were still in college, or did you not even learn what programming was until after you finished school?

    • @sentdex
      @sentdex  8 ปีที่แล้ว +6

      Criminology and Philosophy. I started learning to program ~ junior year in college, but that wasn't from any courses in college or anything.

  • @aleksandarbonev6278
    @aleksandarbonev6278 7 ปีที่แล้ว

    Great video, thanks for the clear instructions. One question I have is, for positive images does orientation matter. Say I have 100 images. If I copy them and set them at each orientation so I end up with 400 images, will that work making the positive images more or will it not matter for opencv?

  • @peretz7
    @peretz7 9 ปีที่แล้ว +1

    When I use your image for the samples and training the number of steps per stage go above 40, but when I use my own image (resized as 50x50) it only trains for a maximum of 10 steps per stage (sometimes as low as 1 or 2! ) and the cascade file is very small... I tried a lot of other pictures, different interpolations for cropping, different dpi etc. It still doesn't work. The object is not detected :(.

    • @engenharia.salles
      @engenharia.salles 8 ปีที่แล้ว

      +Paolo Moldovan I am having the same problem. Did you solve this problem?

    • @shuangli5715
      @shuangli5715 6 ปีที่แล้ว

      I'm having the same problem as well. Did you fix it?

    • @karishmaahuja6217
      @karishmaahuja6217 6 ปีที่แล้ว

      Even I am facing similar problems.
      1. When I train using some other image it doesn't train as desired. it is always under trained, provided that the image size is 50X50. Hence the image is not detected at all.
      2. When I train using the same' watch5050.jpg' image it is sometimes trained correctly and sometimes over trained. Hence trainer identifies each and everything in the image as a watch.

  • @samshanmukh
    @samshanmukh 6 ปีที่แล้ว

    At 4:18 I got segmentation fault the rest of the output was same as yours. I have 740 negative images. Please tell me why I got this error.

    • @samshanmukh
      @samshanmukh 6 ปีที่แล้ว

      I was following the docs.opencv.org tutorial but I got the same error their so I came to watch your tutorial and again this same error.

  • @xavalex100
    @xavalex100 6 ปีที่แล้ว

    Superb tutorial. Curiously, I get *** Error in `opencv_createsamples': corrupted double-linked list when creating more positive samples. Any clue on this?

  • @DandiTerrorGaming
    @DandiTerrorGaming 2 ปีที่แล้ว

    Hello, well maybe it's too late for me to ask this. But, the link to get the image can't be reached right now. Can you tell me the alternative for the link. Thanks love your blog and vids

  • @arnoldadikrishna5772
    @arnoldadikrishna5772 8 ปีที่แล้ว

    Hi Sentdex. Thanks for your video. Just one quick question.
    I have multiple positive images (a bit different with yours), and I saved the positive images as you suggested in the previous video (the number of object, x position, y position, width, and height information after the path directory of the corresponding image). Finally, I saved it in pos.dat file. However, when I types the exact command like yours in the command prompt, there was nothing in my info folder.
    I typed this command in my command prompt:
    opencv_createsamples -img pos.dat -bg neg.txt -info info/info.lst -pngoutput info -num 60
    I only have 60 negative images as my samples.
    Nevertheless, if I used only a single positive image, just like you, I got the info.lst and all the images in my info folder.
    here is what I typed in the command prompt:
    opencv_createsamples -img rct.png -bg neg.txt -info info/info.lst -pngoutput info -num 60
    Please give me your advice. Once again, thanks for your videos.
    -Arnold

  • @marianina8
    @marianina8 6 ปีที่แล้ว

    if you create samples and train with a height and width other than 20x20, like 100x100, I understand that it'll take longer to train but will the haar cascade trained with a larger width and height only detect objects of 100x100 or smaller sizes as well?

  • @sylmarmusic
    @sylmarmusic 8 ปีที่แล้ว +2

    For all those who get the problem: 'opencv_createsamples': free(): corrupted unsorted chunks0x...'
    1)Open notepad in linux.
    2)Type(TYPE, NOT COPY) first line.
    3)Copy and paste everything you had in bg.txt, except the first line.
    4)Save file as bg1.txt
    5)Use bg1.txt instead of bg.txt.
    Cheers and thanks to @sentdex for amazing tutorials!

    • @Yashuu96
      @Yashuu96 8 ปีที่แล้ว

      Thank you so much brother! You're awesome. Where'd you find this?

    • @sylmarmusic
      @sylmarmusic 7 ปีที่แล้ว

      Well let's say it's my previous experience! :)

  • @tanmaypate6048
    @tanmaypate6048 6 ปีที่แล้ว

    I am trying to train a classifier to detect stop sign and I am aiming to have 1000 positive images, and 2000 negative images.
    Can you please tell me,
    1. Is it necessary to have different positive images or I can have a same image multiple times with different names?

  • @fenildankhara3204
    @fenildankhara3204 5 ปีที่แล้ว

    the training was done for only one image. so what do next to train for multiple positive images??

  • @steffansood6007
    @steffansood6007 5 ปีที่แล้ว

    thankyou for the tutorial ....i have a question ....i already have a positive images with me so i am not running the first opencv_createsamples command, but on second opencv_createsamples command at the time of creating vector you have specified 1950 so this 1950 is the number of positive images.?.. as i have only 200 positive images so do i have to put 200 at the place of 1950.?
    also what is the use of negative images for me..for you it has been used to create positive images only...but do i also need negative images if i already have the positive images....please reply i am confused

  • @akieshrajan
    @akieshrajan 8 ปีที่แล้ว

    Hello,
    I am working on my own set of positive images and negative images. How will the process change in that case.

  • @fersanta7109
    @fersanta7109 8 ปีที่แล้ว +3

    Great tutorial!, but i have a question about the opencv_createsamples: if a have a text file with several images coordenates like this img/img1.jpg 1 140 100 45 45 img/img2.jpg 2 100 200 50 50 ... who can i put this txt file in this code line opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950, because i'm trying to repleace -img watch5050.jpg to -img info.txt but doesn's work. my apologize for my bad english.

  • @MichaelUtah
    @MichaelUtah 3 ปีที่แล้ว

    Hello, can i use this method to detect human heads from any angle (not using the face here)?

  • @cleiraraujojunior1880
    @cleiraraujojunior1880 4 ปีที่แล้ว

    Hi Sentdex. I'm a parallel programmer, so how can i run simultaneously many opencv_createsamples's instances using diferents watchs images to build a lot of various positive examples, and afterward, create an entire xml dataset, i mean, cacatenated?

  • @chmage
    @chmage 7 ปีที่แล้ว

    Hello, I'm having the error while trying to run the opencv_createsamples: parse errorDone. Created 20 samples
    what is wrong?

  • @bryangarcia4153
    @bryangarcia4153 7 ปีที่แล้ว

    does haar cascade work better if the positive is transparent?

  • @duckchillings3696
    @duckchillings3696 5 ปีที่แล้ว

    My cascade is drawing tons of boxes everywhere. What does this mean? Training was corrupted?

  • @chihyingtseng1740
    @chihyingtseng1740 7 ปีที่แล้ว

    sorry for bothering you ,when I use Linux Vps to download those package libopencv-dev...,etc. But it seems most of the packages aren't available, what should I do

  • @leterax9477
    @leterax9477 7 ปีที่แล้ว

    Is this gpu memory or cpu heavy? You keep talking about memory but I dont see what part would use that much

    • @NabhoneelMajumdar
      @NabhoneelMajumdar 6 ปีที่แล้ว

      I don't think OpenCV can utilize the GPU.

  • @top10appliannces90
    @top10appliannces90 6 ปีที่แล้ว

    How to train for multiple images for the same positive input, if I have two images for cars how I train them, every time I use the command the info.lst still have the same number of rows, should I combine the different lists manually?

  • @xiaonan238
    @xiaonan238 5 ปีที่แล้ว

    May I ask how to upload file from my computer to the digital ocean server

  • @Gk-cl7kf
    @Gk-cl7kf 6 ปีที่แล้ว

    Can I create a classifier to classify a seat belt from a dash board camera image and how to specify the roi of the positive image?

  • @shubhpatni2123
    @shubhpatni2123 4 ปีที่แล้ว

    opencv_createsamples command not found. But opencv is installed

  • @iqbalwidodo496
    @iqbalwidodo496 8 ปีที่แล้ว +1

    nice tutorial, thanks
    btw my opencv_createsamples is working and no error, but inside the info folder there is nothing. i'm doing exactly the same as the tutorial do. any solution?? i use 1600 negative image and i use -num 1500
    please help...

    • @iqbalwidodo496
      @iqbalwidodo496 8 ปีที่แล้ว

      oh, sorry my bad. make sure your image name is right, i mean if you have pic1.JPG reconvert and save it as pic1.jpg, the capital is also become the trouble. hope works

    • @Naveenkumar-no4or
      @Naveenkumar-no4or 8 ปีที่แล้ว

      Same for me

  • @TheSoundGrid.
    @TheSoundGrid. 7 ปีที่แล้ว

    Hello Sentdex (Harrison) , I am getting this error "info/info.lst(1) : parse errorDone. Created 0 samples" . I have info.lst file & files in annotation folder generated correctly.

    • @TheSoundGrid.
      @TheSoundGrid. 7 ปีที่แล้ว

      Hey Sentdex,
      Got everything working by Changing the following command
      From original pngoutput to jpgoutput . Was that an error or it should have worked fine with pngoutput as well?
      "opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst
      -jpgoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950"

  • @bhanu0047
    @bhanu0047 8 ปีที่แล้ว

    First up.. thank u for the tutorial..
    My Query is that if there is a reason for scaling to resize the negative images to 100*100 after downloading?? what if my positive image is of 240*480 ?

  • @mickmickymick6927
    @mickmickymick6927 3 ปีที่แล้ว

    "opencv_createsamples is not a recognised command". I added it to path and still gogt nothing.

  • @philmanders3373
    @philmanders3373 6 ปีที่แล้ว

    hey i keep getting Create training samples from images collection...
    info/info.lst(501) : parse errorDone. Created 500 samples. Ive tried switching the pngoutput put to jpgoutput and i was able to get a larger sample i just do not know where to go from there.

  • @himanshupandey3600
    @himanshupandey3600 4 ปีที่แล้ว

    How to give multiple positive images as input to the opencv_createsample command?

  • @vaibhavrai5360
    @vaibhavrai5360 7 ปีที่แล้ว

    can i train samples with my own laptop cpu ????or its like important to use VPS to train??

  • @Kyzuuh
    @Kyzuuh 8 ปีที่แล้ว

    I'm not getting any errors but when I run opencv_createsamples everything looks the same as your's does in BASH but there aren't any samples being created.

    • @gharbe93
      @gharbe93 8 ปีที่แล้ว

      bg.txt must have no space at the end

    • @jessewiklanski7800
      @jessewiklanski7800 8 ปีที่แล้ว

      don't forget to put sudo in front of what he has. He didn't us sudo because he is working as root. usually you will see an error but I had the same problem you are having and there was no error, when I added sudo in front and it worked.

    • @Sahil_Shukla98
      @Sahil_Shukla98 8 ปีที่แล้ว

      I dont get it whats that supposed to mean? no spaces how? I am getting the same error btw no output.

    • @gharbe93
      @gharbe93 8 ปีที่แล้ว

      I faced the same error and there was an empty line at the end of bg.txt
      I delete the the line and it works fine
      good luck :)

    • @Rafael_GVM
      @Rafael_GVM 7 ปีที่แล้ว

      I did what you said and my info folder still empty even deleting the blank line at the end of bg.txt

  • @abhijeetarora2743
    @abhijeetarora2743 8 ปีที่แล้ว

    i'm getting " Invalid background description file" error and info.lst file is created in info directory.
    I'm using `Linux ip-generic #80-Ubuntu SMP ` on amazon aws

  • @as269
    @as269 6 ปีที่แล้ว

    is the final cascade file should be 300 k size??

  • @sumedhaagarwal702
    @sumedhaagarwal702 8 ปีที่แล้ว

    I am constantly getting "Invalid background description file."
    Please help in removing it!!

  • @scqthe4654
    @scqthe4654 5 ปีที่แล้ว

    How would you do this using a previously marked collection?

  • @marshallt3050
    @marshallt3050 7 ปีที่แล้ว

    If I didn't want to use just one image and then use opencv to create positives from the negatives. How would I make the info.lst file from a list of my own set of positives images?

  • @oppenaumania
    @oppenaumania 5 ปีที่แล้ว

    thank you so much for that amazing chanel!
    but i have one question to that lesson here... how can i create the trainingdata, if i have more then 1 photo from the object?
    for example, i have 4 photos, but i want to create for each photo ~10.000 positives. do i need to create 4 different haarcascade files or can i train it with one run?

    • @oppenaumania
      @oppenaumania 5 ปีที่แล้ว

      @O R for me its working fine! really no error? i used just the commands from sentdex and modified them for my needs.

    • @oppenaumania
      @oppenaumania 5 ปีที่แล้ว

      @O R the amount of samples. i created 11000 positive images and use 8000 negs

    • @playing-with-light6192
      @playing-with-light6192 5 ปีที่แล้ว

      The Linux problem sounds like the dos2unix problem. Have you tried that? I am using the 18.04 lts Ubuntu in VMware on windows 10. It works fine for me!

  • @Braam7Beresford
    @Braam7Beresford 7 ปีที่แล้ว

    Quick and simple fix to the old 'Invalid background description' is to in the linux terminal delete original bg.txt type 'nano bg.txt', t should be empty, paste all the bg.txt data from your computer, and then save it

  • @vincentlestertogle8887
    @vincentlestertogle8887 6 ปีที่แล้ว

    I made a info.dat file coz i have many positive images, how do i execute it in cmd?

  • @gemhan2079
    @gemhan2079 5 ปีที่แล้ว +1

    thanks for your tutorial. I tried the opencv_createsamples command line on the terminal. but got "-bash: opencv_createsamples: command not found" error. I learnt from the internet that opencv4 no longer provides create sample function. when I tried opencv3.4, the situation is the same. I am using MacOS and Pycharm -- python3. Hope anybody could help me out.

  • @vitomadio
    @vitomadio 7 ปีที่แล้ว

    Hello Sentdex! congrats for the tutorial! I just hope you could help with a problem i have.
    When i run the "opencv_createsamples ..." I don't get any errors but info folder remains empty with no results. I have all the directories in the same directory where my project is, and my bg.txt file is ok. What could be wrong? im using mac osx and python35, I'm not using vps. Thx in advance!

    • @jainilpatel4488
      @jainilpatel4488 6 ปีที่แล้ว

      same problem can you solve that ?

  • @ranickpatra6013
    @ranickpatra6013 7 ปีที่แล้ว

    opencv_createsamples -img watch5050.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1950
    gives me error 'Segmentation fault (core dumped)'

    • @basmamohammed1605
      @basmamohammed1605 7 ปีที่แล้ว

      Tueque did you find the solution to this problem?

  • @jainilpatel4488
    @jainilpatel4488 6 ปีที่แล้ว

    all are work correct BUT in info folder there are nothing . not empty space in bg.txt please help as soon as possible ….! thanks in advance..

  • @kooser6
    @kooser6 5 ปีที่แล้ว

    Can I run all this on a mac without getting a web server?

  • @thamarathalagahage6704
    @thamarathalagahage6704 4 ปีที่แล้ว

    First of all, thank you so much for this great tutorial series.I followed the exact same method as you did upto the level which is described in this video.
    But at the training stage, after executing the opencv_traincascade...... command i'm getting the following error at about stage 5;
    Aborted (core dumped)
    Could you please tell me how to solve this?

  • @RexIbaraki
    @RexIbaraki 5 ปีที่แล้ว

    I created my own positive images. and i have crated an info.lst too to match the images. the data i'm working with is of type TIF. which are colored images. I was restricted to not turn the data into grayscale image. if i run the create_smaples with my info.lst, it prompts this error: "images/resized/info.lst(1) : parse errorDone. Created 0 samples". i'm lost. pls help.

  • @vaibhavsingh9843
    @vaibhavsingh9843 7 ปีที่แล้ว

    i m using 1117 negative images and i have created bg.txt file but when i m running this command ----
    opencv_createsamples -img pos12.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 1050
    i m getting error as ----
    Invalid background description file.
    please help me out

  • @akhilkrishnan615
    @akhilkrishnan615 5 ปีที่แล้ว

    @sentdex: could you tell me how we can train car license plate images using cnn and keras

  • @static75
    @static75 9 ปีที่แล้ว +1

    I can't get create_samples to work to make a whole bunch of positives from one single positive and the pile of background images. Is anyone else having a problem? I found one sentence on his website tutorial that states:
    "If you're a wizard and have figured out how to run create_samples and such on Windows, congratulations! "
    So, I guess this doesn't work on windows? Why not?

  • @top10appliannces90
    @top10appliannces90 6 ปีที่แล้ว

    How to train for multiple images for the same positive input, if I have two images for cars how I train them, every time I use the command the info.lst still have the same number of rows

    • @hang0401
      @hang0401 6 ปีที่แล้ว

      I use this to combine 2 vec files together
      github.com/wulfebw/mergevec

  • @Synasonic
    @Synasonic 6 ปีที่แล้ว

    Would I be able to run these commands on my windows terminal? I would rather use my pc over a server as I have much more ram and a gpu

    • @oppenaumania
      @oppenaumania 5 ปีที่แล้ว

      use a virtualmachine. i am doing the same with vmware and ubuntu. 32GB RAM on my windowsmachine and 4GB for the virtualmachine are enough to do some first steps.

  • @FritzFurtz
    @FritzFurtz 8 ปีที่แล้ว +1

    Hey! When I put this Command:
    opencv_createsamples -img 1.jpg -bg bg.txt -info /info/info.lst -pngoutput /info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 2000
    and I look in the Folder info its empty? Any ideas? By the way: It says: Create test samples from single image [...] Done.
    EDIT: Ok now it says invalid background description file.

    • @jainilpatel4488
      @jainilpatel4488 6 ปีที่แล้ว

      hey this problem is solved ? because I have also that problem images can't show in the info file

  • @nuwan78
    @nuwan78 8 ปีที่แล้ว

    I get - libdc1394 error: Failed to initialize libdc1394 error and i get empty info file

  • @tuomonieminen6831
    @tuomonieminen6831 8 ปีที่แล้ว

    For those having the "invalid background description file":
    I created the .txt file on the linux server. You can do this inside the WinSCP windows as well. After this I just copied the data from the original bg.txt and everything ran smoothly.

  • @FritzFurtz
    @FritzFurtz 8 ปีที่แล้ว

    Would it be better to use 4GB Memory?

  • @xuelaiw1894
    @xuelaiw1894 8 ปีที่แล้ว

    Error in `opencv_createsamples': corrupted double-linked list: 0x00000000018e48e0
    Any idea?
    Appreciate

  • @vdmusic0911
    @vdmusic0911 4 ปีที่แล้ว

    hey mate, I was creating Haarcascade for plant detection. and after "opencv_createsamples -img plant15050 .jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 900" command, I'm getting Aborted(core dumped) message. Please help me out. Thank you

  • @musicjunction7430
    @musicjunction7430 7 ปีที่แล้ว

    I am getting the error " Image reader cannot be created from -vec postives.vec and -bg bg.txt"
    please help

    • @neelbhalla1710
      @neelbhalla1710 7 ปีที่แล้ว

      ah, you are either missing positives.vec or bg.txt . Bg.txt has a program which generates it and opencv_createsamples has a -vec positives.vec argument that will create it when generating the positives.

  • @nuwan78
    @nuwan78 8 ปีที่แล้ว

    i did it using digital ocean server , but i get empty info folder after "opencv_createsamples -img my.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 830" command

    • @fotunetab
      @fotunetab 8 ปีที่แล้ว

      your image size may be an issue...
      check it.

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว

      I use the sizes given in tutorial ,what image sizes should i use,did you face the same problem?

    • @fotunetab
      @fotunetab 8 ปีที่แล้ว

      no i didn't ... but it worked for me...i am working in ubuntu on my PC.

    • @nuwan78
      @nuwan78 8 ปีที่แล้ว

      what sizes did you use

    • @fotunetab
      @fotunetab 8 ปีที่แล้ว

      50x50...

  • @BieAnimation
    @BieAnimation 4 ปีที่แล้ว

    Hey Sent, in my case, this return a error: POS current samplOpenCV Error: Bad argument (Can not get new positive sample. The most possible reason is *insufficient count of samples in given vec-file.
    ) in get, file /build/opencv-iC2m9y/opencv-3.2.0+dfsg/apps/traincascade/imagestorage.cpp, line 158
    terminate called after throwing an instance of 'cv::Exception'
    what(): /build/opencv-iC2m9y/opencv-3.2.0+dfsg/apps/traincascade/imagestorage.cpp:158: error: (-5) Can not get new positive sample. The most possible reason is insufficient count of samples in given vec-file.
    in function get
    *
    2000 negative files
    Could you help me?

  • @MichaelTsimmerman
    @MichaelTsimmerman 5 ปีที่แล้ว

    couldn't find anywhere weather there is a way to run it at 4 cores , (yeah, im running it on a pi Im scared it'll explode but isnt it all the fun?)

  • @bbf2rob3
    @bbf2rob3 8 ปีที่แล้ว

    hello sentdex,
    we tried your tutorial and at first everything worked fine.
    But then we tried using more images and more training stages to make the recognition more accurate. Unfortunatly now we are running into this error everytime we start the progress again:
    opencv_traincascade -data data -vec vector.vec -bg jpg/bg.txt -numPos 60 -numNeg 30 -numStages 5 -h 20 -w 20
    ===== TRAINING 0-stage =====

    • @nanduraj1104
      @nanduraj1104 7 ปีที่แล้ว

      I have the same problem. Did you solve it?

    • @nanduraj1104
      @nanduraj1104 7 ปีที่แล้ว

      Hi, I have the same problem. Did you solve it?

  • @farkasamongergely
    @farkasamongergely 8 ปีที่แล้ว +2

    Hi Sentdex, I love your tutorials, you are awesome! But with this
    particular step I had a serious issue. When it comes generating the info.lst, the opencv_createsamples returns a weird error message. I will just paste it in:
    *** Error in `opencv_createsamples': free(): corrupted unsorted chunks:0x0000000001d8d730 ***
    The chunk Id is diferent every time I run the command, I think it has something to do with the jpg's metadata... By the way I'm using a virtual machine to emulate ubuntu.I would appreciate if you could help me solve this problem.
    Sorry for my crappy english, I'm not a native speaker...
    Stay awesome!
    Amon Farkas

    • @geraldoneto123
      @geraldoneto123 8 ปีที่แล้ว

      Same here. Could you please help us ? Great tutorial!

    • @Sahil_Shukla98
      @Sahil_Shukla98 8 ปีที่แล้ว

      try rebooting your system if that doesn't help use this tool called diehard

    • @Yashuu96
      @Yashuu96 7 ปีที่แล้ว +2

      Refer the solution of this problem here -
      stackoverflow.com/a/42739019/7060773

    • @Sahil_Shukla98
      @Sahil_Shukla98 7 ปีที่แล้ว

      Yash Gupta i was able to solve the issue though i had to re download my images

    • @Yashuu96
      @Yashuu96 7 ปีที่แล้ว +1

      Well that's good. But, this solution worked for me though!

  • @prathameshpattar3727
    @prathameshpattar3727 7 ปีที่แล้ว

    Hi.. with one positive image this works perfectly fine.. thank you so much for that..
    Can you please help me out with training the cascade with a number of positive images which i have saved it in the folder named pos?
    I have created the "info.dat" file for the positive images.
    Now while creating samples i use the following command -
    opencv_createsamples -img info.dat - bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle -0.5 -maxzangle 0.5 -num 1100
    but no file "info.lst" is created

    • @sanyamsharma27
      @sanyamsharma27 4 ปีที่แล้ว

      Hi
      I am facing a similar issue
      Can you please tell me how you resolved this

  • @andriipopovych6499
    @andriipopovych6499 3 ปีที่แล้ว

    I have the next problem:
    opencv_traincascade: command not found

  • @MultiToblo
    @MultiToblo 5 ปีที่แล้ว

    What does numbers in columns HR and FA mean?

  • @LAZofPIK
    @LAZofPIK 8 ปีที่แล้ว

    can i use haar cascade for blood detection in video ??

    • @sentdex
      @sentdex  8 ปีที่แล้ว +1

      +Hassouna Laz yes. You'd need to train against a wide variation of blood examples. Splatter/pool/drop trail... etc, or maybe just the one you're specifically interested in.

  • @MouseWanted
    @MouseWanted 9 ปีที่แล้ว

    thank you!

  • @arvrmr7946
    @arvrmr7946 8 ปีที่แล้ว

    I am trying OpenCV on unity . that cascade file is also working for unity .

  • @nainabhateja4547
    @nainabhateja4547 6 ปีที่แล้ว

    Anyone help me..... I have a lot of positive images but i dont know hoe can i generate info.txt file from these.

  • @UtkarshMishra1958
    @UtkarshMishra1958 7 ปีที่แล้ว +1

    Getting an error message : 'free() : invalid next size(normal)'. Anyone one else facing the same problem ?

  • @gamedistortion
    @gamedistortion 6 ปีที่แล้ว +1

    If you're getting a message "error(-5)" after running the opencv_traincascade command. Try the command "sudo chmod 777 bg.txt" without the quotes.

  • @vidumini23
    @vidumini23 5 ปีที่แล้ว

    Thank you

  • @XDavidT5
    @XDavidT5 6 ปีที่แล้ว

    There is no way to run it without using cloud ?

    • @sentdex
      @sentdex  6 ปีที่แล้ว

      Sure, use ubuntu locally :P

  • @ShivaPrasadGuntuku529
    @ShivaPrasadGuntuku529 7 ปีที่แล้ว

    what images 'neg' dir consist off ??

    • @sentdex
      @sentdex  7 ปีที่แล้ว

      Images that do NOT have our object in them.

  • @Ch4grin
    @Ch4grin 6 ปีที่แล้ว +1

    You're misinterpreting your memory usage. Linux always tries to use all of its memory (why not?) and uses any spare memory, after process requirements, for caching files.Think of it Linux using any spare physical memory as a SSD. That memory is shown in "cached" in top, and in your example was running between 1.2 to .9GB.
    The physical memory used by your traincascade process -- the stuff stuck in your RAM chips -- is shown in the list under RES. That varied a bit. The VIRT column shows the total memory used by the process including swap. Well, granted you don't have swap, and you've got plenty of physical memory so it still keeps it in physical memory, but it's stuff that the process is using that doesn't need to be in physical memory.
    So, in summary, used - (buffers + cached) = how much physical memory my computer needs to run right now.

  • @adarshdubey6123
    @adarshdubey6123 7 ปีที่แล้ว

    opencv_createsamples -img image5050.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 690 command is not producing any info.lst file possible reasons and solutions please

  • @semerefilmon2419
    @semerefilmon2419 6 ปีที่แล้ว

    nothing happened when i copied and pasted the files to the server

  • @abhilashkumar23
    @abhilashkumar23 8 ปีที่แล้ว

    I am getting following error when i run opencv_traincascade command :-
    OpenCV Error: Assertion failed (_img.cols == winSize.width) in get, file /builddir/build/BUILD/OpenCV-2.0.0/apps/traincascade/imagestorage.cpp, line 86
    terminate called after throwing an instance of 'cv::Exception'
    can anyone help, i'm stuck here and it's killing me

  • @lochannification
    @lochannification 6 ปีที่แล้ว +1

    opencv_createsamples -img 2.png -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 10
    Info file name: info/info.lst
    Img file name: 2.png
    Vec file name: (NULL)
    BG file name: bg.txt
    Num: 10
    BG color: 0
    BG threshold: 80
    Invert: FALSE
    Max intensity deviation: 40
    Max x angle: 0.5
    Max y angle: 0.5
    Max z angle: 0.5
    Show samples: FALSE
    Width: 24
    Height: 24
    Max Scale: -1
    RNG Seed: 12345
    Create test samples from single image applying distortions...
    Segmentation fault (core dumped)
    Could you please help me with this issue :)

    • @thekiran
      @thekiran 6 ปีที่แล้ว +1

      Were you able to fix that error?

    • @vaibhavchavhan4905
      @vaibhavchavhan4905 5 ปีที่แล้ว

      Have you found any solution??

  • @nuwan78
    @nuwan78 8 ปีที่แล้ว

    for super fast fast servers use google cloud compute engine . you can use up to 8 cpus. This is better for training any size of image.just open a free trial and use for 60 days.

  • @fotunetab
    @fotunetab 8 ปีที่แล้ว

    Hey +sentdex
    I am stuck over here.... Plz tell where i have possibly gone wrong...
    ===== TRAINING 0-stage =====