cdnuts commited on
Commit
e1bf142
·
verified ·
1 Parent(s): d4d4a7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -56,9 +56,9 @@ def _dynGPU(
56
  def dynGPU(
57
  fn: Callable[P, R] | None = None,
58
  duration: Callable[P, int] = lambda: 60,
59
- min=30,
60
  max=300,
61
- step=10,
62
  ) -> Callable[P, R]:
63
  if fn is None:
64
  return partial(_dynGPU, duration=duration, min=min, max=max, step=step)
@@ -260,9 +260,7 @@ def process_images(images, threshold):
260
 
261
  batch = batch.to(device)
262
  with torch.no_grad():
263
- logits = model(batch)
264
- probabilities = torch.nn.functional.sigmoid(logits)
265
-
266
  for i, prob in enumerate(probabilities):
267
  indices = torch.where(prob > threshold)[0]
268
  values = prob[indices]
 
56
  def dynGPU(
57
  fn: Callable[P, R] | None = None,
58
  duration: Callable[P, int] = lambda: 60,
59
+ min=10,
60
  max=300,
61
+ step=5,
62
  ) -> Callable[P, R]:
63
  if fn is None:
64
  return partial(_dynGPU, duration=duration, min=min, max=max, step=step)
 
260
 
261
  batch = batch.to(device)
262
  with torch.no_grad():
263
+ probabilities = model(batch)[0]
 
 
264
  for i, prob in enumerate(probabilities):
265
  indices = torch.where(prob > threshold)[0]
266
  values = prob[indices]