-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOG not working #48
Comments
I have the same issue when running the train script on openSUSE 42.3 using the published binary for Julia 0.6. It stops at the first image in the humans directory (./humans/per00001.ppm) with a message similar to the one reported.
|
This bug is resolved on the master branch but a release was subsequently never tagged. Hence when you do Pkg.add("ImageFeatures") you currently don't get the latest version. If you checkout the master branch things will work as expected. It looks like tejus-gupta fixed the problem as part of commit #42. @Evizero could you please tag a release when you have a spare moment? |
Thanks for the reminder |
Thanks for this, which fixes that particular issue; now the process stops when trying to process the non_human images, finding an issue with incompatible images, the size of which must be a multiple of the cell size:
However there seems to be some confusion over sources of data for this tutorial addressed in other issues. The process stops with the first non_human image, which in my case is 1.jpg and is a 65x129 image of a brick wall with a barred window in top right quadrant. Anyone else find the same thing? |
I'm surprised to hear that you are getting a 65 x 129 image. Did you try load the image using a different image editor to confirm the size? Might be worth validating to be sure its not a bug in Julia. Are all of the non-human images likes that? You could, of course, just re-size the images to be of size 64 by 128 as a workaround. |
@zygmuntszpak Yes I opened in a couple other applications and all confirmed the odd image size. Resizing was the solution, now the tutorial runs to completion with the somewhat surprising result of 100% accuracy. |
I can verify that most of the tutorial works if you In the code it says: #Split the dataset into train and test set. Train set = 2500 images, Test set = 294 images.
random_perm = randperm(n)
train_ind = random_perm[1:2500]
test_ind = random_perm[2501:end] Nevertheless my train set has 924 images not 2500 ! Another detail: I get all scores as 0 (this is weird) Therefore the object locations part of the tutorial do not work. scores[scores.>0] = 0
object_locations = findlocalminima(scores)
0-element Array{CartesianIndex{2},1} |
Hmm that is strange; the data looks ok to me:
|
@colbec where did you download the data? could you post the url here? thank you! |
@davidbp David, see your comment in the other issue at #44 (comment) ; you should find it leads to a non-human set of images as one component. The collection contains images with a number of different sizes and some of these are not compatible with the cell size of the HOG analysis. All I have done so far is to resize all of them to a standard 64x128 but other solutions might lead to a more accurate result. |
Thank you for comment, I've read all comments from the two issues but I still don't see what data are you referring to. I could only find 2 links:
|
Your comment in the other issue refers to https://github.com/mbeyeler/opencv-machine-learning/tree/78f5f6ecfbbae3f61b378060d60641420331115c/notebooks/data/chapter6 ; see pedestrians_neg file. |
Thank you for your clarification Nevertheless the positive set of examples in the link you just posted doesn't have 2500 examples. So I assume that from the 50 negative examples and from the 940 positive examples you have generated a train set containing 2500 examples... right? |
Oh I see, I must have obtained the positive examples from one of the other sources, and by luck ended up with an approximately right combination. I'm having a problem discovering where the data came from and will have to go back through my history to see which source it came from. I'll post back when I find it. |
@davidbp OK it looks like the positive data came from @zygmuntszpak suggestion of the Wayback machine at #44 (comment) |
@colbec that data from @zygmuntszpak has 924 images. The same images as in the link you provide above (which I provided in another thread). Anyway thank you for commenting the issue. |
I think we should 1 - Clarify exactly what is the data (where to download it) Then close this thread once we have a notebook with "reproducible" results. |
@davidbp Yes you are right, evidently that is not the source, I will keep looking but am very puzzled where it might have come from - my browser history is not much help in this case. I just examined my not_humans directory and find that it contains 1870 items, which together with the 924 from humans totals 2794. When the tutorial takes the train set of 2500 this leaves 294 for the test set, given the count of files that I have. I did not do any image engineering to produce more examples. |
I have redone the notebook from scratch changing some parts that didn't work. https://github.com/davidbp/learn_julia/blob/master/JuliaImages/pedestrian_detection.ipynb This notebook works with the data we already know where to get (we could even put it in a github repo since It is quite small). The negative samples I used are simply patches of the 50 negatives samples of the dataset we found. I can close this issue anytime but it would be nice to merge/adapt this code that works. |
The download link is now fixed for downloading pedestrian dataset as provided by @davidbp in JuliaImages#44. The odd size of 65x129 is also fixed as reported by @colbec in JuliaImages#48.
Closed in #60 |
Hello,
I have tried the HOG code but it does not seem to work.
The following code:
returns
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: