예제 #1
0
 def post(self, nop=None):
     log.info("Home.post")
     try:
         data = json.loads(self.request.body.decode('utf-8'))
         hit_id = mturk.create_hit("https://s3.amazonaws.com/%s/%s.wav" % (config['s3']['bucket'], data['t']))
         if hit_id != False:
             model.add_clip(data['t'], hit_id)
     except Exception as e:
         return self.error(e)
     return self.text("OK")
예제 #2
0
 def post(self, nop=None):
     log.info("Home.post")
     try:
         data = json.loads(self.request.body.decode("utf-8"))
         hit_id = mturk.create_hit("https://s3.amazonaws.com/%s/%s.wav" % (config["s3"]["bucket"], data["t"]))
         if hit_id != False:
             model.add_clip(data["t"], hit_id)
     except Exception as e:
         return self.error(e)
     return self.text("OK")
예제 #3
0
    def handle(self, *args, **options):
	    mturk.create_hit()
#
# MTURK IMAGE ANNOTATION TOOL
#

# Creates a HIT for the specified images.

import sys
from uuid import UUID

import mturk

print('CURRENT BALANCE:', mturk.account_balance())

uuids = list(map(UUID, sys.argv[1:]))

mturk.dev_template_reload(
    f'https://s3.amazonaws.com/gttc2/mturk/images/{uuids[0]}.jpg')

hit = mturk.create_hit(
    f'https://s3.amazonaws.com/gttc2/mturk/images/{uuids[0]}.jpg')

print(hit)