|
Using the tutorial on multiclass adaboost, I'm trying to classify some images that have two classes (but I don't suppose the algorithm shouldn't work if the problem is binary). Then I'm going to extend my samples to include other classes. My current test is quite small, only 17 images in all, 10 for training, 7 for testing. (I'll add more samples later, right now I just want to get the code up and running). For now I have two classes: 0: no vehicle, 1: vehicle present I used integer labels because according to the example in the link above, the training data consists of integer-based labels. I've edited the provided example only a bit, to include my own image files, but I'm getting the following error:
The relevant part of my code is below:
What am I doing wrong, and what needs to be fixed? EditHere are the samples, in order to replicate the error: |
|
Could you provide a sample so that I can try and reproduce the error? The error itself means you are trying to do something mathematically invalid with a numpy array, such as having incorrect dimensions/sizes between rows of a matrix or a mixed type (float, int, string) violation. Sure, I've edited the question to add the links to all 17 images. I tried uploading a zipped file so I could just link you to that, but unfortunately that didn't work out. So I'm afraid you'll have to download these individually! So I used the first ten images for training and the rest for testing. I know a real classifier will need tons more images but like I said I'll add them later.
(Apr 12 '14 at 03:17)
asaaki
Before you actually run any of your classifiers, check the length of the array objects in your test set. In other words, run something like: X_train, X_test = img_hogs[:n_split], img_hogs[n_split:] for x in X_train:
Do they match?
(Apr 12 '14 at 09:39)
Daniel E Margolis
I've done that, they don't match. The length of some are 1728, but others are 1344, and others are 7600, and so on... But I've already resized the images to the same size, then what's wrong?
(Apr 13 '14 at 03:23)
asaaki
Do you get the same errors if you run my code with the given samples?
(Apr 13 '14 at 07:40)
asaaki
Well, there were a few lines I had to add (you didn't include some of the imported libraries), but I do get an error with your samples. When I only use those samples with the same size, I don't get an error.
(Apr 13 '14 at 09:39)
Daniel E Margolis
but how is this happening? isn't resize(curr_img,(60,40)) supposed to take care of that?
(Apr 13 '14 at 14:53)
asaaki
showing 5 of 6
show all
|