Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat are good features for classifying photos of clothing?
    primarykey
    data
    text
    <p>I want to build a clothing classifier that takes a photo of an item of clothing and classifies it as 'jeans', 'dress', 'trainers' etc.</p> <p>Some examples:</p> <p><img src="https://i.stack.imgur.com/hPclH.jpg" alt="jeans"> <img src="https://i.stack.imgur.com/8uezA.jpg" alt="trainer"> <img src="https://i.stack.imgur.com/596xp.jpg" alt="enter image description here"></p> <p>These images are from retailer websites, so are typically taken from the same angle, typically on a white or pale background -- they tend to be very similar.</p> <p>I have a set of several thousand images whose category I already know, which I can use to train a machine-learning algorithm.</p> <p>However, I'm struggling for ideas of what features I should use. The features I have so far:</p> <pre><code>def get_aspect_ratio(pil_image): _, _, width, height = pil_image.getbbox() return width / height def get_greyscale_array(pil_image): """Convert the image to a 13x13 square grayscale image, and return a list of colour values 0-255. I've chosen 13x13 as it's very small but still allows you to distinguish the gap between legs on jeans in my testing. """ grayscale_image = pil_image.convert('L') small_image = grayscale_image.resize((13, 13), Image.ANTIALIAS) pixels = [] for y in range(13): for x in range(13): pixels.append(small_image.getpixel((x, y))) return pixels def get_image_features(image_path): image = Image.open(open(image_path, 'rb')) features = {} features['aspect_ratio'] = get_aspect_ratio(image) for index, pixel in enumerate(get_greyscale_array(image)): features["pixel%s" % index] = pixel return features </code></pre> <p>I'm extracting a simple 13x13 grayscale grid as a crude approximation of shape. Howerver, using these features with nltk's <code>NaiveBayesClassifier</code> only gets me 34% accuracy. </p> <p>What features would work well here?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload