How do I use the Supplied test set option in Weka for a dataset of images?

classic Classic list List threaded Threaded
1 message Options
Lou
Reply | Threaded
Open this post in threaded view
|

How do I use the Supplied test set option in Weka for a dataset of images?

Lou
I am using Weka for a research and I need to use a custom test set that I
have put together.

However, I still cant manage. I have tried a few ways, but none work.

Here is what I did for the train set:
I loaded the train set using Image Directory Loader. Initially I struggled
with that, so I
renamed the folder 'train' (it used to be 'Train')
created an .csv file containing all the images in the train set in the
following format:
./(class name of the image)/(name of image).png
After these changes I successfully loaded the train set.
I also created an .arff file using an online converter, which also worked
and the data was loaded successfully
I supposed the same method would work for the test set.

Using Image Directory Loader:
I navigate to my 'test' folder
I click 'Open' without having chosen a specific object, I am just inside the
folder, and nothing happens. This worked for my training set. I do not even
receive and error message

Using an .arff file:
Using the comandline, I created a .txt file which contains all the names of
the elements within the test folder (I used dir /b/s > file.txt  )
I edited the textfile to this format: ./(class name of the image)/(name of
image).png
I coped the contents of the file, pasted them into Google Sheets, and
downloaded the file as .csv
I then converted the .csv file to .arff file using an online converter;
there was a setting about whether the first or second row contains the
label; I tried both and none worked
I tried inserting it as a supplied test set and nothing. I didn't know what
was wrong since I didn't receive any error message and tried loading the
.arff file in a separate Weka Explorer window as a train set and I received
this messsage: "File not recognized a Arff data files Reason: Unable to
determine structure as .arff (Reason: java.lang.IllegalArgumentException: A
nominal attribute (.speedlimit/332.png) cannot have duplicate labels
(./Speed))." What confuses me is that I do not have duplicate labels; it's
only one. On the train set I had done the same mistake, but I had forgotten
the train: "train/speedlimit.332.png". I erased the "train" and it worked.

Am I missing anything?



--
Sent from: https://weka.8497.n7.nabble.com/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to [hidden email]
To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html