jiexunsee / Simple-Inception-Transfer-Learning

A classifier for cat and dog images (Response to Siraj's challenge of the week)
38 stars 32 forks source link

How would I use this project for image sorting #6

Closed ProGamerGov closed 7 years ago

ProGamerGov commented 7 years ago

I would like to use this project in order to sort the images in my data sets, so that I can create more classes, and so that I can remove unwanted images.

I was thinking about something like this, where unsorted images are taken from an input folder, and placed into the appropriate category folder:

Unsorted Images ---> Pre-Trained Model ---> Image Category 1

Unsorted Images ---> Pre-Trained Model ---> Image Category 2

But I am not sure how exactly I would use this project to do so. Is there a simpler way to accomplish this task?

jiexunsee commented 7 years ago

Hi @ProGamerGov ,

You'd probably need to have sets of images labelled into your different categories, and then you can train the inception transfer learning model to be able to classify new images that you feed into the model. Hope this helps! I'm not sure if there's any simpler way to do it, but I think if you are using images then the inception model is really convenient for classification.

lunasdejavu commented 7 years ago

@jiexunsee I still don't get it

how to transform the training data I want to 2048-dimensional vector representations?

jiexunsee commented 7 years ago

the classifier script will do that for you and save the 2048 dimensional vectors in a text file.

lunasdejavu commented 7 years ago

thank you :D but I encountered another problem it did the training when it hadn't finished turning all the images to 2048 the dimensional vectors Inception-V3 is processing images: |############### | 5191/10959 Epoch 1/30: 100%|███████████████████████████| 7/7 [00:00<00:00, 92.72batches/s] I changed the parameters a little learning_rate = 0.0001 batch_size = 512 epochs = 30 log_batch_step = 50 what is wrong with it?

jiexunsee commented 7 years ago

Hmm that is interesting, I'm not sure why that happens. So you have 10959 images and it only processes 5191 of them?

On 18 Jun 2017, at 9:10 PM, lunasdejavu notifications@github.com wrote:

thank you :D but I encountered another problem it did the training when it hadn't finished turning all the images to 2048 the dimensional vectors Inception-V3 is processing images: |############### | 5191/10959 Epoch 1/30: 100%|███████████████████████████| 7/7 [00:00<00:00, 92.72batches/s] I changed the parameters a little learning_rate = 0.0001 batch_size = 512 epochs = 30 log_batch_step = 50 what is wrong with it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

lunasdejavu commented 7 years ago

yeah your original code is perfect, I tried once before. I only modified the parameters and `image_dir = '/home/lunasdejavu/cecums_transfer_data' file_list = [] file_glob = os.path.join(image_dir, '*.jpg') file_list.extend(gfile.Glob(file_glob))

# I only used 300 images from the cats and dogs dataset
file_list = file_list[0:10959]
bar = Bar('Inception-V3 is processing images:', max=10959)
for file_name in file_list:`
jiexunsee commented 7 years ago

Oh.. I have no idea why that's happening haha, maybe check your image folder?

jiexunsee commented 7 years ago

if the problem still occurs you could try using this repository it's much faster and I think it's simpler!

lunasdejavu commented 7 years ago

ok Thank you !!

I found it was my stupid fault after all.

jiexunsee commented 7 years ago

haha ok glad that it's resolved! :)