Skip to content

Instantly share code, notes, and snippets.

@alexandr
alexandr / scale_helper.rb
Last active September 20, 2016 18:12
Scale Integration for Scale Annotation Demo
module ScaleHelper
def create_annotation_task(callback_url, objects_to_annotate, attachment)
@@connection.post '/v1/task/annotation', {
:callback_url => callback_url,
:objects_to_annotate => objects_to_annotate,
:attachment => attachment,
:attachment_type => "image",
:instruction => "Annotate the specified objects",
:urgency => "immediate"
}
@alexandr
alexandr / sample.sh
Created September 18, 2016 20:28
Annotation Endpoint Example
curl "https://api.scaleapi.com/v1/task/annotation" \
-u YOUR_SCALE_API_KEY: \
-d callback_url="http://www.example.com/callback" \
-d instruction="Draw a box around each baby cow and adult cow." \
-d attachment_type=image \
-d attachment="http://i.imgur.com/v4cBreD.jpg" \
-d objects_to_annotate="baby cow" \
-d objects_to_annotate="adult cow" \
-d with_labels=true