Luna’s digital sweatshop


There must be a way…

Luna squished with two feet near head and paws on hand

How do I do this?

Think, think, think, think…

Luna with face down into pillow and tail up

How do I organize all my pictures.  There are soooo many!  How?

Wait!

Luna laying in a cat bad with one paw out of the bed looking intensely at what's in front of her

Wait just a second.  I think what I need…

… is Amazon.com’s “Mechanical Turk”!

Luna laying on cat bed with head turned at camera

Let me explain…

Amazon provides this service that lets you distribute labor, consisting of repetitive menial tasks, to workers all over the world who are willing and able to work for peanuts.

Luna in cat bed in front of monitor

A cat is lucky to even have peanuts.  On average, they get less $1.50 per HOUR.  I do what I have to do.

It’s genius!

Luna with leaning head on edge of bed with one paw out looking to side

I can have them describe my 618 cat pictures that don’t have descriptions.

Don’t give me that look.  I’m not going to pay them that little.

Luna with leaning head on edge of bed with one paw out looking at camera

I mean, I expect very high quality descriptions of my pictures!

First, I’ll use Dropbox to put small versions of them online.

Then I’ll write up a little python script, to let Mechanical Turk know where they are:

(You don’t have to understand the python code)

import urllib
from os import listdir
from os.path import isfile, join

o = open('mech_turk_input.csv', 'w')

o.write("image_url1,image_url2,image_url3\r\n")
a = []

def listfiles(target_path):
    files = [ f for f in listdir(target_path) if isfile(join(target_path,f)) ]
    for str in files:
        enc = urllib.quote(str)
        a.append("https://dl.dropboxusercontent.com/u/28419853/lunapix/%s" % enc)
        if len(a) == 3:
            o.write("%s,%s,%s\r\n" % (a[0],a[1],a[2]))
            a[:] = []

listfiles("new_luna_imgs")
listfiles("old_luna_imgs")

That generates the comma-separated URLs…

Screenshot 2015-03-18 02.10.06

Then, on Amazon, I will upload that list and create a form like this:

Screenshot 2015-03-18 02.13.33

See how it loads my little pictures in?  That’s how they’ll be describing my pictures.

Three at a time, which should help improve efficiency.

Hopefully they’ll do a decent job.

Luna with leaning head on edge of bed with one paw out and eyes half closed

I want good descriptions.  Mechanical Turk lets you reject bad results, but that’d be a shame if I had to.

I’m getting tired from all that effort.  YAWN!

Luna stretched out under blanket with legs and tail sticking out starting to yawn

It was a small Python script, but cats normally don’t program at all.

Meow.  Submitting.

Screenshot 2015-03-14 22.18.43

Look at them work!  See, that hourly rate isn’t too bad.

Now let’s check out what sort of descriptions they’re coming up with.

Screenshot 2015-03-14 18.43.36

Not bad, not bad.  Wait… what’s this?

Screenshot 2015-03-14 18.44.21

I think that third one is missing.  That’s too bad.

So tired!  YYYYYYAAAAAAAAAAAAAA…..

Luna stretched out under blanket with legs and tail sticking out mouth open wide in a yawn

…AAAAAAAAWWWWWWWWNNNNNN!

Luna stretched out under blanket with legs and tail sticking out looking up

Rejected.

Meow.  What else we got?

Screenshot 2015-03-14 22.21.20

Meow?  I’ll check the pictures:

This is me doing pushups?

Screenshot 2015-03-14 22.22.03

And this…

This is me staring at something that isn’t there…

Screenshot 2015-03-14 22.22.15

Whatever that is.  So descriptive!

And invisible string?

Screenshot 2015-03-14 22.22.26

Maybe there really IS invisible string in that one.

No matter.

Luna laying on bed with blanket and eyes awake

Rejected!

A few of them look good, but it’s going to take a while.  What’s this “Workers” page?

Screenshot 2015-03-14 23.32.50

Yeah, I see a couple of workers who are not that great, but look at that dude who got my approval ten out of 10 times!

*click*

Screenshot 2015-03-15 00.03.45

Purr!…  $0.10 coming to you!

Screenshot 2015-03-15 00.04.27

Meow.  Nevermind.

Time for sleep.  Purrpurr…

Luna laying on bed with blanket

ZZZZzzzzz….

Good morning!

Luna laying on blanket facing camera from afar with rear foot showing

Let’s see where we are.  Approve, approve, approve…

YAY!

Screenshot 2015-03-16 22.07.25

All 618 pictures are done!

Now I’ll just write another little script to change the output into a “photo renaming script”…

import csv
import urllib

o = open('rename.sh', 'w')

with open('cat_descs.csv', 'rb') as f:
    next(f)
    for row in csv.reader(f, delimiter=','):
        for i in range(0, 3):
            if row[16] == "Approved":
                old_fn_with_path = row[27+i]
                new_fn = row[30+i]
                fn_path_list = old_fn_with_path.rsplit('/', 1)
                old_fn_encoded = fn_path_list[1]
                old_fn = urllib.unquote(old_fn_encoded)
                new_fn = new_fn.rstrip('.')
                o.write('mv "%s" "%s.jpg"\n' % (old_fn,new_fn))

And I’ll run it…

Purr!  Looking good!

Screenshot 2015-03-16 23.25.10

First try!

And wait… a spelling error?

Screenshot 2015-03-16 23.26.58

Fixing!

Meow!  There are so many typos that I have to fix!

Luna on blanket on sofa at window sleeping

To be honest, I probably could have written the descriptions in less time than it took me to deal with all the problems I’ve encountered.

Running the picture renaming script on the full size pictures.  Finally!

Screenshot 2015-03-16 23.49.13

Purr!

Now you know a little bit about how I operate.

Luna laying down on a cushion wide awake with eyes open

It’s important, you know.  I need to find my pictures!

And… time to sleep again…

Luna is laying on her back on a cushion eyes squinted and front paws drawn up

Purrpurrpurr… Zzzzz….

Advertisements
Categories: Actually HappenedTags: , , , , , , , , , , , , , ,

8 comments

  1. That sounds incredibly useful. I have so many photos. The problem is going to be releasing control of my images to others to name, being the control freak I am! But at least Luna gave me an avenue. Thanks, Luna!

    Liked by 1 person

    • I mentioned making “small” versions of the images. Instead of the 5000 pixel-width images, I made them into 360 pixel-width images. You could watermark them too, but I didn’t bother. Pictures don’t sell too well these days. I used “Capture One” to export them as the smaller images, and I used to use “ResizeMe” for that. There are a bunch of other tools which can do the same. The problem is that there are some workers that do a pretty bad job at your task, even when I requested “Master-level workers”. But when I rejected enough, they stopped and only the good workers continued to finish the rest up.

      Like

  2. Could you append each image with a code that helps you at least narrow down the sorting process?

    E.g. [photo month and year] [larm] [rarm] [lleg][rleg] [room][where in room][sleeping /awake]

    this way, sleeping with all limbs curled up near East window in dining room, in Feb 15 would be

    0215ccccDEWS
    If you have several photos that fit the description you can number them in order.

    0215_1ccccDEWS
    0215_2 ccccDEWS

    etc.

    Liked by 1 person

    • Hmm… it could work. Would take a ton of effort though. It seems to actually work where you just type 5-10 words about what a picture is about… noting prominent features. I’m not sure if I could outsource the scientific coding that you proposed…for reasonable money anyway. I think your solution could be the ideal though. The main problem I noticed, with the outsourcing, is that they don’t have a feel for what certain things are. They might call something maroon when it’s really brown in person, or they might refer to something as a “little house” when it’s a room in a cat tree. So I wouldn’t find them. But most of these pictures weren’t too important, and I can fix the ones I care about down the road anyway 🙂

      Like

  3. If you ever decide to write a post about String Theory you could use the photo of Luna trying to look at an “invisible string” to illustrate it.

    Liked by 1 person

  4. Hey Scott.
    Luna sure is a little cutie.
    I don’t really get how to use these types of programs and all. Like you said toward the end, “I probably could have written the descriptions in less time than it took me to deal with all the problems I’ve encountered.”
    I noticed you’re an indie filmmaker. My hubby’s a filmmaker. He’s done two feature-length films, a few shorts and a few documentaries as well. He’s going to Lebanon in December to produce/direct a documentary and will be directing another feature-length soon.
    Hope you’re well.
    🙂

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: