YYama0 commited on
Commit
3657e14
·
verified ·
1 Parent(s): a65dbaf

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +2 -2
inference.py CHANGED
@@ -207,7 +207,7 @@ class RadFigClassifier:
207
  'image_path': image_paths,
208
  'filename': [os.path.basename(path) for path in image_paths],
209
  'prediction': predictions,
210
- 'suitable_for_vqa': predictions > 0.5 if return_probabilities else predictions.astype(bool)
211
  })
212
 
213
  # Sort by filename for consistency
@@ -250,7 +250,7 @@ def main():
250
  else:
251
  print(f"Image: {args.input}")
252
  print(f"Probability suitable for VQA: {prediction:.4f}")
253
- print(f"Classification: {'suitable' if prediction > 0.5 else 'not suitable'}")
254
 
255
  elif os.path.isdir(args.input):
256
  # Directory prediction
 
207
  'image_path': image_paths,
208
  'filename': [os.path.basename(path) for path in image_paths],
209
  'prediction': predictions,
210
+ 'suitable_for_vqa': predictions > 0.9 if return_probabilities else predictions.astype(bool)
211
  })
212
 
213
  # Sort by filename for consistency
 
250
  else:
251
  print(f"Image: {args.input}")
252
  print(f"Probability suitable for VQA: {prediction:.4f}")
253
+ print(f"Classification: {'suitable' if prediction > 0.9 else 'not suitable'}")
254
 
255
  elif os.path.isdir(args.input):
256
  # Directory prediction