6666 SLICE_ID_KEY ,
6767 TRACK_REFERENCE_IDS_KEY ,
6868 TRACKS_KEY ,
69+ TRAINED_SLICE_ID_KEY ,
6970 UPDATE_KEY ,
7071 VIDEO_URL_KEY ,
7172)
@@ -1793,6 +1794,7 @@ def upload_predictions(
17931794 batch_size : int = 5000 ,
17941795 remote_files_per_upload_request : int = 20 ,
17951796 local_files_per_upload_request : int = 10 ,
1797+ trained_slice_id : Optional [str ] = None ,
17961798 ):
17971799 """Uploads predictions and associates them with an existing :class:`Model`.
17981800
@@ -1841,19 +1843,20 @@ def upload_predictions(
18411843 you can try lowering this batch size. This is only relevant for
18421844 asynchronous=False
18431845 remote_files_per_upload_request: Number of remote files to upload in each
1844- request. Segmentations have either local or remote files, if you are
1845- getting timeouts while uploading segmentations with remote urls, you
1846- should lower this value from its default of 20. This is only relevant for
1847- asynchronous=False.
1846+ request. Segmentations have either local or remote files, if you are
1847+ getting timeouts while uploading segmentations with remote urls, you
1848+ should lower this value from its default of 20. This is only relevant for
1849+ asynchronous=False.
18481850 local_files_per_upload_request: Number of local files to upload in each
1849- request. Segmentations have either local or remote files, if you are
1850- getting timeouts while uploading segmentations with local files, you
1851- should lower this value from its default of 10. The maximum is 10.
1852- This is only relevant for asynchronous=False
1851+ request. Segmentations have either local or remote files, if you are
1852+ getting timeouts while uploading segmentations with local files, you
1853+ should lower this value from its default of 10. The maximum is 10.
1854+ This is only relevant for asynchronous=False
1855+ trained_slice_id: Nucleus-generated slice ID (starts with ``slc_``) which was used
1856+ to train the model.
18531857
18541858 Returns:
18551859 Payload describing the synchronous upload::
1856-
18571860 {
18581861 "dataset_id": str,
18591862 "model_run_id": str,
@@ -1876,7 +1879,11 @@ def upload_predictions(
18761879 predictions , self .id , self ._client
18771880 )
18781881 response = self ._client .make_request (
1879- payload = {REQUEST_ID_KEY : request_id , UPDATE_KEY : update },
1882+ payload = {
1883+ REQUEST_ID_KEY : request_id ,
1884+ UPDATE_KEY : update ,
1885+ TRAINED_SLICE_ID_KEY : trained_slice_id ,
1886+ },
18801887 route = f"dataset/{ self .id } /model/{ model .id } /uploadPredictions?async=1" ,
18811888 )
18821889 return AsyncJob .from_json (response , self ._client )
@@ -1887,6 +1894,7 @@ def upload_predictions(
18871894 update = update ,
18881895 remote_files_per_upload_request = remote_files_per_upload_request ,
18891896 local_files_per_upload_request = local_files_per_upload_request ,
1897+ trained_slice_id = trained_slice_id ,
18901898 )
18911899
18921900 def predictions_iloc (self , model , index ):
0 commit comments