IZERE HIRWA Roger commited on
Commit
8dfdfe9
·
1 Parent(s): 3ec0a4b
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -42,9 +42,12 @@ def segment(image_pil: Image.Image, prompt: str):
42
  # Convert PIL image to numpy array
43
  image_np = np.array(image_pil)
44
 
 
 
 
45
  # Run GroundingDINO to get boxes for the prompt
46
  boxes, _, _ = predict(
47
- model=grounder.to(device), # Ensure model is on CPU
48
  image=image_np,
49
  caption=prompt,
50
  box_threshold=0.3,
 
42
  # Convert PIL image to numpy array
43
  image_np = np.array(image_pil)
44
 
45
+ # Ensure the model is explicitly set to CPU
46
+ grounder.to("cpu")
47
+
48
  # Run GroundingDINO to get boxes for the prompt
49
  boxes, _, _ = predict(
50
+ model=grounder,
51
  image=image_np,
52
  caption=prompt,
53
  box_threshold=0.3,