ammariii08 commited on
Commit
1a4daa4
·
verified ·
1 Parent(s): 3235276

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -8,20 +8,17 @@ from pathlib import Path
8
 
9
  detection_model = AutoDetectionModel.from_pretrained(
10
  model_type='ultralytics',
11
- model_path="/workspace/runs/detect/train2/weights/last.pt", # Replace with your model path
12
  confidence_threshold=0.01,
13
  device="cpu" # Change to 'cuda:0' if you have a GPU
14
  )
15
 
16
- OUTPUT_PATH = "/workspace/pred_image.jpg"
17
- TEMP_PNG_PATH = "/workspace/pred_image.png"
18
 
19
  def run_inference(image):
20
- input_path = "/workspace/input_image.jpg"
21
- cv2.imwrite(input_path, cv2.cvtColor(image, cv2.COLOR_RGB2BGR))
22
-
23
  result = get_sliced_prediction(
24
- input_path,
25
  detection_model,
26
  slice_height=256,
27
  slice_width=256,
 
8
 
9
  detection_model = AutoDetectionModel.from_pretrained(
10
  model_type='ultralytics',
11
+ model_path="./DDR.pt", # Replace with your model path
12
  confidence_threshold=0.01,
13
  device="cpu" # Change to 'cuda:0' if you have a GPU
14
  )
15
 
16
+ OUTPUT_PATH = "./outputs/pred_image.jpg"
17
+ TEMP_PNG_PATH = "./outputs/pred_image.png"
18
 
19
  def run_inference(image):
 
 
 
20
  result = get_sliced_prediction(
21
+ image,
22
  detection_model,
23
  slice_height=256,
24
  slice_width=256,