nucleus.annotation_uploader#
This is a helper class not intended for direct use. Please use dataset.annotate |
|
This is a helper class not intended for direct use. Please use dataset.annotate |
- class nucleus.annotation_uploader.AnnotationUploader(dataset_id, client)#
This is a helper class not intended for direct use. Please use dataset.annotate or dataset.upload_predictions.
This class is purely a helper class for implementing dataset.annotate/dataset.predict.
- Parameters:
dataset_id (Optional[str]) –
client (nucleus.NucleusClient) –
- static check_for_duplicate_ids(annotations)#
Do not allow annotations to have the same (annotation_id, reference_id) tuple
- Parameters:
annotations (Iterable[nucleus.annotation.Annotation]) –
- get_form_data_and_file_pointers_fn(segmentations, update)#
Defines a function to be called on each retry.
File pointers are also returned so whoever calls this function can appropriately close the files. This is intended for use with a FormDataContextHandler in order to make form data requests.
- Parameters:
segmentations (Iterable[nucleus.annotation.SegmentationAnnotation]) –
update (bool) –
- upload(annotations, batch_size=5000, update=False, remote_files_per_upload_request=20, local_files_per_upload_request=10, trained_slice_id=None)#
For more details on parameters and functionality, see dataset.annotate.
- Parameters:
annotations (Iterable[nucleus.annotation.Annotation]) –
batch_size (int) –
update (bool) –
remote_files_per_upload_request (int) –
local_files_per_upload_request (int) –
trained_slice_id (Optional[str]) –
- class nucleus.annotation_uploader.PredictionUploader(client, dataset_id=None, model_id=None, model_run_id=None, trained_slice_id=None)#
This is a helper class not intended for direct use. Please use dataset.annotate or dataset.upload_predictions.
This class is purely a helper class for implementing dataset.annotate/dataset.predict.
- Parameters:
client (nucleus.NucleusClient) –
dataset_id (Optional[str]) –
model_id (Optional[str]) –
model_run_id (Optional[str]) –
trained_slice_id (Optional[str]) –
- static check_for_duplicate_ids(annotations)#
Do not allow annotations to have the same (annotation_id, reference_id) tuple
- Parameters:
annotations (Iterable[nucleus.annotation.Annotation]) –
- get_form_data_and_file_pointers_fn(segmentations, update)#
Defines a function to be called on each retry.
File pointers are also returned so whoever calls this function can appropriately close the files. This is intended for use with a FormDataContextHandler in order to make form data requests.
- Parameters:
segmentations (Iterable[nucleus.annotation.SegmentationAnnotation]) –
update (bool) –
- upload(annotations, batch_size=5000, update=False, remote_files_per_upload_request=20, local_files_per_upload_request=10, trained_slice_id=None)#
For more details on parameters and functionality, see dataset.annotate.
- Parameters:
annotations (Iterable[nucleus.annotation.Annotation]) –
batch_size (int) –
update (bool) –
remote_files_per_upload_request (int) –
local_files_per_upload_request (int) –
trained_slice_id (Optional[str]) –