googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
508 stars 463 forks source link

Added recursive image searching to the retrainer #113

Open Gum-Joe opened 5 years ago

Gum-Joe commented 5 years ago

When using the retrainer script, only the first level of directories is searched. So, given this file tree:

images
   class_1
      image.jpg
   class_2
      sub_class_3
         image2.jpg

Only image.jpg would be detected, not image2.jpg This can be troublesome, for example, when you want an image to also fall into a more broad category, i.e category bottoms, sub-category jeans for a clothing classifier.

I've edited the functioncreate_image_lists to now recursively scan directories for photos, joining categories together with a .. For example, given this file tree:

images
   tops
      t-shirts
         superdry
            t-shirt.jpg
   bottoms
      jeans
            jeans.jpg

t-shirt.jpg would be labelled tops.t-shirts.superdry and jeans.jpg as bottoms.jeans

googlebot commented 5 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

Googlers can find more info about SignCLA and this PR by following this link.

Gum-Joe commented 5 years ago

CLA has been signed.

googlebot commented 5 years ago

CLAs look good, thanks!

Googlers can find more info about SignCLA and this PR by following this link.