Spaces:
Build error
Build error
Update TheDistanceAssessor.py
Browse files- TheDistanceAssessor.py +1 -14
TheDistanceAssessor.py
CHANGED
|
@@ -909,17 +909,4 @@ def run(input_image, model_seg, model_det, image_size, target_distances, num_ys
|
|
| 909 |
|
| 910 |
output_image = get_result(classification, id_map, model.names, borders, image, regions)
|
| 911 |
cropped_image = output_image[22:output_image.shape[0] - 40, 74:output_image.shape[1] - 33]
|
| 912 |
-
return cropped_image
|
| 913 |
-
|
| 914 |
-
if __name__ == "__main__":
|
| 915 |
-
|
| 916 |
-
image_size = [1024,1024]
|
| 917 |
-
target_distances = [650,1000,2000]
|
| 918 |
-
num_ys = 10
|
| 919 |
-
|
| 920 |
-
PATH_model_seg = 'C:/Users/valac/OneDrive - Západočeská univerzita v Plzni/DP/gradio/SegFormer_B3_1024_finetuned.pth'
|
| 921 |
-
PATH_model_det = 'C:/Users/valac/OneDrive - Západočeská univerzita v Plzni/DP/gradio/yolov8s.pt'
|
| 922 |
-
input_image = cv2.imread('C:/Users/valac/OneDrive - Západočeská univerzita v Plzni/DP/gradio/rs00006.jpg') #TO CO VLOZI UZIVATEL
|
| 923 |
-
model_seg = load_segformer(PATH_model_seg)
|
| 924 |
-
model_det = load_yolo(PATH_model_det)
|
| 925 |
-
image = run(input_image, model_seg, model_det, image_size, target_distances, num_ys=num_ys)
|
|
|
|
| 909 |
|
| 910 |
output_image = get_result(classification, id_map, model.names, borders, image, regions)
|
| 911 |
cropped_image = output_image[22:output_image.shape[0] - 40, 74:output_image.shape[1] - 33]
|
| 912 |
+
return cropped_image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|