Open FrankTseng168 opened 3 days ago
Hi @FrankTseng168 👋
Thank you for the report! I'm failing to reproduce it so far. Do you know when this happens?
Any chance you could print out the shape of prediction.xyxy
, before prediction = prediction[np.isin(...)]
? Also, are there any matches in classes, for prediction["class_name"]
?
Hi, LinasKo @.***>
Thank you for your email。Please refer to the following result:
prediction = sv.Detections.from_lmm(sv.LMM.FLORENCE_2, prediction, resolution_wh=image.size)
print(prediction.xyxy)
print(prediction.xyxy.shape)
print(prediction['class_name'])
prediction = prediction[np.isin(prediction['class_name'], CLASSES)]
-> [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['bed'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['table'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['chair'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['furniture'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['bed'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['tablecloth'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['table'] [[198.72 182.08 227.51999 224.95999] [311.36 189.12 409.28 408.63998]] (2, 4) ['human face' 'person'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['bed'] [[3.2000e-01 3.2000e-01 6.3904e+02 6.3904e+02]] (1, 4) ['human face'] [] (0, 4) None
LinasKo @.***> 於 2024年11月27日 週三 下午10:38寫道:
Hi @FrankTseng168 https://github.com/FrankTseng168 👋
Thank you for the report! I'm failing to reproduce it so far. Do you know when this happens?
Any chance you could print out the shape of prediction.xyxy, before prediction = prediction[np.isin(...)]? Also, are there any matches in classes, for prediction["class_name"]?
— Reply to this email directly, view it on GitHub https://github.com/roboflow/notebooks/issues/342#issuecomment-2504043808, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6ULVQWNFHXWDGERVZ3RXL2CXKORAVCNFSM6AAAAABSSNERTOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBUGA2DGOBQHA . You are receiving this because you were mentioned.Message ID: @.***>
Bug confirmed! Very peculiar. I'll let you know when I fix it. Logged here: https://github.com/roboflow/supervision/issues/1694
For now, try this:
if not predictions.is_empty():
prediction = prediction[np.isin(prediction["class_name"], CLASSES)]
If it still fails, change to if len(predictions.xyxy) > 0:
Search before asking
Notebook name
how_to_finetune_florence_2_on_detection_dataset
Bug
Environment
win 11/ python3.11.10/ spyder
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?