174174 Input ("run-train" , "n_clicks" ),
175175 State ("annotation-store" , "data" ),
176176 State ({"type" : "annotation-class-store" , "index" : ALL }, "data" ),
177- State ("project-name-src " , "value" ),
177+ State ("image-uri " , "value" ),
178178 State ("model-parameters" , "children" ),
179179 State ("model-list" , "value" ),
180180 State ("job-name" , "value" ),
@@ -184,7 +184,7 @@ def run_train(
184184 n_clicks ,
185185 global_store ,
186186 all_annotations ,
187- project_name ,
187+ image_uri ,
188188 model_parameter_container ,
189189 model_name ,
190190 job_name ,
@@ -208,7 +208,7 @@ def run_train(
208208 )
209209 return notification , no_update
210210 mask_uri , num_classes , mask_error_message = tiled_masks .save_annotations_data (
211- global_store , all_annotations , project_name
211+ global_store , all_annotations , image_uri
212212 )
213213 model_parameters ["num_classes" ] = num_classes
214214 model_parameters ["network" ] = model_name
@@ -227,7 +227,7 @@ def run_train(
227227 "%Y/%m/%d %H:%M:%S"
228228 )
229229 flow_run_name = f"{ job_name } { current_time } "
230- data_uri = tiled_datasets .get_data_uri_by_name ( project_name )
230+ data_uri = tiled_datasets .get_data_uri_by_trimmed_uri ( image_uri )
231231 io_parameters = assemble_io_parameters_from_uris (data_uri , mask_uri )
232232 io_parameters ["uid_retrieve" ] = ""
233233 io_parameters ["models_dir" ] = RESULTS_DIR
@@ -263,7 +263,7 @@ def run_train(
263263 FLOW_NAME ,
264264 parameters = TRAIN_PARAMS_EXAMPLE ,
265265 flow_run_name = flow_run_name ,
266- tags = PREFECT_TAGS + ["train" , project_name ],
266+ tags = PREFECT_TAGS + ["train" , image_uri ],
267267 )
268268 job_message = f"Job has been succesfully submitted with uid: { job_uid } and mask uri: { mask_uri } "
269269 notification_color = "indigo"
@@ -287,7 +287,7 @@ def run_train(
287287 Input ("run-inference" , "n_clicks" ),
288288 State ("train-job-selector" , "value" ),
289289 State ({"type" : "annotation-class-store" , "index" : ALL }, "data" ),
290- State ("project-name-src " , "value" ),
290+ State ("image-uri " , "value" ),
291291 State ("model-parameters" , "children" ),
292292 State ("model-list" , "value" ),
293293 prevent_initial_call = True ,
@@ -296,7 +296,7 @@ def run_inference(
296296 n_clicks ,
297297 train_job_id ,
298298 all_annotations ,
299- project_name ,
299+ image_uri ,
300300 model_parameter_container ,
301301 model_name ,
302302):
@@ -324,7 +324,7 @@ def run_inference(
324324 model_parameters ["network" ] = model_name
325325
326326 # Set io_parameters for inference, there will be no mask
327- data_uri = tiled_datasets .get_data_uri_by_name ( project_name )
327+ data_uri = tiled_datasets .get_data_uri_by_trimmed_uri ( image_uri )
328328 io_parameters = assemble_io_parameters_from_uris (data_uri , "" )
329329 io_parameters ["uid_retrieve" ] = ""
330330 io_parameters ["models_dir" ] = RESULTS_DIR
@@ -380,7 +380,7 @@ def run_inference(
380380 FLOW_NAME ,
381381 parameters = INFERENCE_PARAMS_EXAMPLE ,
382382 flow_run_name = flow_run_name ,
383- tags = PREFECT_TAGS + ["inference" , project_name ],
383+ tags = PREFECT_TAGS + ["inference" , image_uri ],
384384 )
385385 job_message = (
386386 f"Job has been succesfully submitted with uid: { job_uid } "
@@ -445,10 +445,10 @@ def check_train_job(n_intervals):
445445 Output ("infra-state" , "data" , allow_duplicate = True ),
446446 Input ("model-check" , "n_intervals" ),
447447 Input ("train-job-selector" , "value" ),
448- State ("project-name-src " , "value" ),
448+ State ("image-uri " , "value" ),
449449 prevent_initial_call = True ,
450450)
451- def check_inference_job (n_intervals , train_job_id , project_name ):
451+ def check_inference_job (n_intervals , train_job_id , image_uri ):
452452 """
453453 This callback populates the inference job selector dropdown with job names and ids from Prefect.
454454 The list of jobs is filtered by the selected train job in the train job selector dropdown.
@@ -472,7 +472,7 @@ def check_inference_job(n_intervals, train_job_id, project_name):
472472 if job_name is not None :
473473 data = query_flow_runs (
474474 flow_run_name = job_name ,
475- tags = PREFECT_TAGS + ["inference" , project_name ],
475+ tags = PREFECT_TAGS + ["inference" , image_uri ],
476476 )
477477 infra_state = no_update
478478
@@ -489,7 +489,7 @@ def check_inference_job(n_intervals, train_job_id, project_name):
489489
490490def populate_segmentation_results (
491491 job_id ,
492- project_name ,
492+ image_uri ,
493493 job_type = "training" ,
494494):
495495 """
@@ -498,7 +498,7 @@ def populate_segmentation_results(
498498 """
499499 # Nothing has been selected is job_id is None
500500 if job_id is not None :
501- data_uri = tiled_datasets .get_data_uri_by_name ( project_name )
501+ data_uri = tiled_datasets .get_data_uri_by_trimmed_uri ( image_uri )
502502 # Only returns the name if the job finished successfully
503503 job_name = get_flow_run_name (job_id )
504504 if job_name is not None :
@@ -515,7 +515,7 @@ def populate_segmentation_results(
515515 # First refresh the data client,
516516 # the root container may not yet have existed on startup
517517 tiled_results .refresh_data_client ()
518- result_container = tiled_results .get_data_by_trimmed_uri (
518+ result_container = tiled_results .get_data_slice_by_trimmed_uri (
519519 expected_result_uri
520520 )
521521 except Exception :
@@ -551,16 +551,16 @@ def populate_segmentation_results(
551551 Output ("seg-results-train-store" , "data" ),
552552 Output ("dvc-training-stats-link" , "href" ),
553553 Input ("train-job-selector" , "value" ),
554- State ("project-name-src " , "value" ),
554+ State ("image-uri " , "value" ),
555555 prevent_initial_call = True ,
556556)
557- def populate_segmentation_results_train (train_job_id , project_name ):
557+ def populate_segmentation_results_train (train_job_id , image_uri ):
558558 """
559559 This callback populates the segmentation results store based on the uids
560560 if the training job and the inference job.
561561 """
562562 notification , result_store , segment_job_id = populate_segmentation_results (
563- train_job_id , project_name , "training"
563+ train_job_id , image_uri , "training"
564564 )
565565 if segment_job_id is not None :
566566 results_link = f"/results/{ segment_job_id } /dvc_metrics/report.html"
@@ -574,16 +574,16 @@ def populate_segmentation_results_train(train_job_id, project_name):
574574 Output ("notifications-container" , "children" , allow_duplicate = True ),
575575 Output ("seg-results-inference-store" , "data" ),
576576 Input ("inference-job-selector" , "value" ),
577- State ("project-name-src " , "value" ),
577+ State ("image-uri " , "value" ),
578578 prevent_initial_call = True ,
579579)
580- def populate_segmentation_results_inference (inference_job_id , project_name ):
580+ def populate_segmentation_results_inference (inference_job_id , image_uri ):
581581 """
582582 This callback populates the segmentation results store based on the uids
583583 if the training job and the inference job.
584584 """
585585 notification , result_store , _ = populate_segmentation_results (
586- inference_job_id , project_name , "inference"
586+ inference_job_id , image_uri , "inference"
587587 )
588588 return (
589589 notification ,
0 commit comments