Items
Attach items
You can attach items via a list of URLs or via URLs in a CSV file.
To attach items via a list of URLs:
sa.attach_items(
project = "Cars",
attachments = [
{ "name": "16797.jpg", "url": "https://test-1212.s3.amazonaws.com/50k2sep/0.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=oNlHqhZHiK5GzgWZi%2F46dIoQ%2B%2BA%3D&Expires=1651063405" },
{ "name": "16798.jpg", "url": "https://test-1212.s3.amazonaws.com/50k2sep/1.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=bYWiGrW8ET56pUcTCrlqhF5EX%2BY%3D&Expires=1651063405" },
{ "name": "16799.jpg", "url": "https://test-1212.s3.amazonaws.com/50k2sep/10.jpg?AWSAccessKeyId=AKIA5BP2G2NHEPGBCUX2&Signature=OXtzqrgAlEViDbTM5RHeOA%2BGBLk%3D&Expires=1651063405" }
],
annotation_status="NotStarted"
)
To attach items via CSV files:
sa.attach_items(
project = "Trucks",
attachments = "/Users/joshbrown/trucks_image_urls.csv",
annotation_status="NotStarted"
)
Move items
To move items in bulk from one folder to another:
sa.move_items(
source = "Folder 1",
destination = "Folder 2",
items = ["analysis1.txt","analysis2.txt"],
)
Copy items
To copy items from one folder and paste them in another folder:
sa.copy_items(
source = "Folder 1",
destination = "Folder 2",
items = ["947483.jpeg","847484.jpeg"],
include_annotations = False
)
Set annotation status
To set the annotation status of one item or multiple items:
sa.set_annotation_statuses(
project = "Sentiment Analysis",
annotation_status = "QualityCheck",
items = ["56038.txt", "56039.txt"]
)
Query
To run a query:
superannotate.query(
project = "Project 1"
query = "metadata(status = InProgress AND annotatorEmail = [email protected])"
)
This function returns the metadata of the items in a list form.
Learn more about queries here.
Search items
To search for items in a project:
superannotate.search_items(
project="Project 1")
To search for items whose names contain car
:
superannotate.search_items(
project="Project 1",
name_contains="car")
To search for items whose names contain car
and have the annotation status InProgress
:
superannotate.search_items(
project="Project 1",
name_contains="car",
annotation_status="InProgress")
To search for items by the assigned Annotator and QA’s email addresses:
superannotate.search_items(
project="Project 1",
name_contains="car",
annotation_status="InProgress",
annotator_email="[email protected]",
qa_email="[email protected]")
Annotation status
The
annotation_status
field can have one of the following values:NotStarted
,InProgress
,QualityCheck
,Returned
,Completed
, andSkipped
.
To search for items in the whole project, including folders:
superannotate.search_items(
project="Project 1",
name_contains="car",
annotation_status="InProgress",
annotator_email="[email protected]",
qa_email="[email protected]",
recursive=True
)
The function will return a list of metadata objects for items that satisfy search criteria.
Get item metadata
To get an item’s metadata:
superannotate.get_item_metadata(
project="Project 1",
item_name="Image1.png")
Here’s the returned data.
Image
{
"name": "example.jpeg",
"path": "project/folder_1",
"url": "https://sa-public-files.s3.../text_file_example_1.jpeg",
"annotation_status": "NotStarted",
"annotator_email": "[email protected]",
"qa_email": "[email protected]",
"entropy_value": null,
"createdAt": "2022-02-15T20:46:44.000Z",
"updatedAt": "2022-02-15T20:46:44.000Z",
"prediction_status": "NotStarted",
"segmentation_status": null,
"approval_status": "disapproved",
"is_pinned" : False
}
Description:
name
: File namepath
: Item’s path in the SuperAnnotate project. This is an example of a path: //.url
: Item’s URL. If the item was uploaded from the computer, the value isNone
. If the item was added via an integration, the value is the integration storage’s path. If the item is attached, the value is the URL.annotation_status
: The item’s annotation status.annotator_email
: The assigned annotator’s email address.qa_email
: The assigned QA’s email address.entropy_value
: The item’s priority score.createdAt
: The date when the item was created.updatedAt
: The date when the item was last updated.prediction_status
: The item’s Smart Prediction status. The values are:NotStrated
,InProgress
,Completed
, andFailed
.segmentation_status
: The item’s Smart Segmentation status. The values are:NotStarted
,InProgress
,Completed
, andFailed
. It’sNone
for Vector Projects.approval_status
: The item’s approval status. The values areapproved
for approved items anddisapproved
for disapproved items. It’sNone
for items that are neither approved nor disapproved.is_pinned
: The value isTrue
for pinned items andFalse
for items that aren't pinned.
Video
{
"name": "example.jpeg",
"path": "project/folder_1/meow.jpeg",
"url": "https://sa-public-files.s3.../text_file_example_1.jpeg",
"annotation_status": "NotStarted",
"annotator_email": null,
"qa_email": null,
"entropy_value": null,
"createdAt": "2022-02-15T20:46:44.000Z",
"updatedAt": "2022-02-15T20:46:44.000Z",
"approval_status": "approved"
}
Description:
name
: File namepath
: Item’s path in the SuperAnnotate project.url
: Item’s URL. If the item was added via an integration, the value is the integration storage’s path. If the item is attached, the value is the URL.annotation_status
: The item’s annotation status.annotator_email
: The assigned annotator’s email address.qa_email
: The assigned QA’s email address.entropy_value
: The item’s priority score.createdAt
: The date when the item was created.updatedAt
: The date when the item was last updated.approval_status
: The item’s approval status. The values areapproved
for approved items anddisapproved
for disapproved items. It’sNone
for items that are neither approved nor disapproved.
Document
{
"name": "example.jpeg",
"path": "project/folder_1/meow.jpeg", // <proj>/<folder>/<itemname>
"url": "https://sa-public-files.s3.../text_file_example_1.jpeg",
"annotation_status": "NotStarted",
"annotator_name": null,
"qa_name": null,
"entropy_value": null,
"createdAt": "2022-02-15T20:46:44.000Z",
"updatedAt": "2022-02-15T20:46:44.000Z"
}
Description:
name
: File namepath
: Item’s path in the SuperAnnotate project.url
: Item’s URL. . If the item was added via an integration, the value is the integration storage’s path. If the item is attached, the value is the URL.annotation_status
: The item’s annotation status.annotator_email
: The assigned annotator’s email address.qa_email
: The assigned QA’s email address.entropy_value
: The item’s priority score.createdAt
: The date when the item was created.updatedAt
: The date when the item was last updated.
Updated 3 days ago