66
66
SLICE_ID_KEY ,
67
67
TRACK_REFERENCE_IDS_KEY ,
68
68
TRACKS_KEY ,
69
+ TRAINED_SLICE_ID_KEY ,
69
70
UPDATE_KEY ,
70
71
VIDEO_URL_KEY ,
71
72
)
@@ -1793,6 +1794,7 @@ def upload_predictions(
1793
1794
batch_size : int = 5000 ,
1794
1795
remote_files_per_upload_request : int = 20 ,
1795
1796
local_files_per_upload_request : int = 10 ,
1797
+ trained_slice_id : Optional [str ] = None ,
1796
1798
):
1797
1799
"""Uploads predictions and associates them with an existing :class:`Model`.
1798
1800
@@ -1841,19 +1843,20 @@ def upload_predictions(
1841
1843
you can try lowering this batch size. This is only relevant for
1842
1844
asynchronous=False
1843
1845
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.
1848
1850
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.
1853
1857
1854
1858
Returns:
1855
1859
Payload describing the synchronous upload::
1856
-
1857
1860
{
1858
1861
"dataset_id": str,
1859
1862
"model_run_id": str,
@@ -1876,7 +1879,11 @@ def upload_predictions(
1876
1879
predictions , self .id , self ._client
1877
1880
)
1878
1881
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
+ },
1880
1887
route = f"dataset/{ self .id } /model/{ model .id } /uploadPredictions?async=1" ,
1881
1888
)
1882
1889
return AsyncJob .from_json (response , self ._client )
@@ -1887,6 +1894,7 @@ def upload_predictions(
1887
1894
update = update ,
1888
1895
remote_files_per_upload_request = remote_files_per_upload_request ,
1889
1896
local_files_per_upload_request = local_files_per_upload_request ,
1897
+ trained_slice_id = trained_slice_id ,
1890
1898
)
1891
1899
1892
1900
def predictions_iloc (self , model , index ):
0 commit comments