Skip to content
Kevin Mader edited this page Aug 3, 2018 · 7 revisions

Welcome to the jupyanno wiki!

Creating a new task

annotation_task = {
    'google_forms': {'form_url': 'https://docs.google.com/forms/d/e/1FAIpQLSfBmvqCVeDA7IZP2_mw_HZ0OTgDk2a0JN4VlY5KScECWC-_yw/viewform', 
    'sheet_url': ''
            },
    'dataset': {
        'image_path': 'Image Index', # column name
        'output_labels': 'Finding Labels', # column name
        'dataframe': ds_df.to_dict(),
        'base_image_directory': 'sample_data' # path
    }
}

with open('task.json', 'w') as f:
    json.dump(annotation_task, f)

Google Forms Backend

The simpliest backend is Google Forms which is what we will use as our append-only setup. First create a public google form with the following short-response fields

  • annotator
  • task
  • item_id
  • label
  • session
  • time

Then go to share/send and get the link which should look something like this

This is the URL to insert in the task.json under the form_url field

You can then create a google sheet for the output which is publically visible (anyone with a link can view)

PyMongo Setup

US_AUTH = {"dbuser": "web_demo", "dbpassword": "webdemo1", "full_mongo_uri": "mongodb://{dbuser}:{dbpassword}@mongodb://<dbuser>:<dbpassword>@ds263791.mlab.com:63791/jupyanno_us_demo", "dburl": "ds263791.mlab.com", "dbport": 63791, "dbname": "jupyanno_us_demo"}
from pymongo import MongoClient
cxn = MongoClient(annotation_task['auth']['dburl'], annotation_task['auth']['dbport'])
db = cxn[annotation_task['auth']['dbname']]
db.authenticate(annotation_task['auth']['dbuser'], annotation_task['auth']['dbpassword'])
collection = db['annotations']
collection.insert_one({'junk': 123})
Clone this wiki locally