API
The API class is in charge of calling remo end-points. You shouldn’t need to look here, except if you want to implement new end-points.
class remo.api.API¶
documentation
class remo.api.API(server, email, password)
add_annotation¶
documentation
add_annotation(dataset_id, annotation_set_id, image_id, existing_annotations=None, classes=None, objects=None)
bulk_upload_files¶
documentation
bulk_upload_files(dataset_id, files_to_upload, annotation_task=None, folder_id=None, annotation_set_id=None, class_encoding=None, session_id: str = None)
chunks¶
documentation
chunks(my_list, chunk_size=2000)
complete_upload_session¶
documentation
complete_upload_session(session_id: str)
create_annotation_set¶
Creates a new empty annotation set :param - annotation_task: str.
name of the annotation task
documentation
create_annotation_set(annotation_task, dataset_id, name, classes=[])
-
Parameters
-
dataset_id (-) – int. the id of the dataset to create new annotation set
-
name (-) – str. Name of the annotation set to create.
-
classes (-) – list of str. list of classes. Example: [‘Cat’, ‘Dog’]
-
create_dataset¶
documentation
create_dataset(name)
create_new_upload_session¶
documentation
create_new_upload_session(dataset_id: int)
delete_dataset¶
Deletes dataset
documentation
delete_dataset(dataset_id: int)
-
Parameters
dataset_id – dataset id
export_annotations¶
Exports annotations for a given annotation set in a given format.
It offers some convenient export options, including:
-
Methods to append the full_path to image filenames,
-
Choose between coordinates in pixels or percentages,
-
Export tags to a separate file
-
Export annotations filtered by user-determined tags.
documentation
export_annotations(annotation_set_id: int, annotation_format='json', export_coordinates='pixel', full_path=True, export_tags: bool = True, filter_by_tags: list = None)
-
Parameters
-
annotation_set_id – annotation set id
-
annotation_format – can be one of [‘json’, ‘coco’, ‘csv’]. Default: ‘json’
-
full_path – if True, appends file path to the filename. uses full image path. Default: True
-
export_coordinates – converts output values to percentage or pixels, can be one of [‘pixel’, ‘percent’]. Default: ‘pixel’
-
export_tags – if True, exports the tags to a separate CSV file. Default: True
-
filter_by_tags – allows to export annotations only for images containing certain image tags. It can be of type List[str] or str. Default: None
-
-
Returns
annotation file content
get_annotation_info¶
documentation
get_annotation_info(dataset_id, annotation_set_id, image_id)
-
Parameters
-
dataset_id – dataset id
-
annotation_set_id – annotation set id
-
image_id – image id
-
Returns: annotations info
get_annotation_set¶
documentation
get_annotation_set(id)
get_dataset¶
documentation
get_dataset(id)
get_image¶
documentation
get_image(image_id)
get_image_content¶
documentation
get_image_content(url)
get_upload_session_status¶
documentation
get_upload_session_status(session_id: str)
list_annotation_set_classes¶
Lists annotation set classes
documentation
list_annotation_set_classes(annotation_set_id: int)
-
Parameters
annotation_set_id – int.
Returns: list of classes
list_annotation_sets¶
documentation
list_annotation_sets(dataset_id)
list_dataset_contents¶
documentation
list_dataset_contents(dataset_id, limit=None)
list_dataset_contents_by_folder¶
documentation
list_dataset_contents_by_folder(dataset_id, folder_id, limit=None)
list_dataset_images¶
documentation
list_dataset_images(dataset_id, limit=None, offset=None)
list_datasets¶
documentation
list_datasets()
search_images¶
Search images given a list of classes and tasks :param dataset_id: narrows search result to given dataset :param annotation_sets: narrows search result to given annotation sets (can be multiple, e.g. [1, 2]) :param classes: string or list of strings - search for images which match all given classes :param classes_not: string or list of strings - search for images which excludes all given classes :param tags: string or list of strings - search for images which match all given tags :param tags_not: string or list of strings - search for images which excludes all given tags :param image_name_contains: search for images which name contains given pattern :param limit: limits number of search results (by default returns all results)
documentation
search_images(dataset_id: int, annotation_sets: int = None, classes: str = None, classes_not: str = None, tags: str = None, tags_not: str = None, image_name_contains: str = None, limit=None)
-
Returns
list of JSON objects (images and annotations)
split_files_by_size¶
documentation
split_files_by_size(files)
upload_file¶
documentation
upload_file(dataset_id, path, annotation_task=None, folder_id=None)
upload_files¶
documentation
upload_files(dataset_id, files_to_upload=[], annotation_task=None, folder_id=None, status=None, annotation_set_id=None, class_encoding=None, session_id: str = None)
upload_local_files¶
documentation
upload_local_files(dataset_id, local_files, annotation_task=None, folder_id=None, annotation_set_id=None, class_encoding=None, session_id: str = None)
upload_urls¶
documentation
upload_urls(dataset_id, urls, annotation_task=None, folder_id=None, annotation_set_id=None, class_encoding=None, session_id: str = None)
class remo.api.BaseAPI¶
documentation
class remo.api.BaseAPI(server, email, password)
delete¶
documentation
delete(\*args, \*\*kwargs)
get¶
documentation
get(\*args, \*\*kwargs)
post¶
documentation
post(\*args, \*\*kwargs)
public_url¶
documentation
public_url(endpoint, \*args, \*\*kwargs)
set_public_url¶
documentation
set_public_url(public_url: str)
url¶
documentation
url(endpoint, \*args, \*\*kwargs)
class remo.api.UploadStatus¶
documentation
class remo.api.UploadStatus(total_count)
progress¶
documentation
progress()
update¶
documentation
update(count)