File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 2020 CountingResult ,
2121 Detector ,
2222 ImageQuery ,
23+ MultiClassificationResult ,
2324 PaginatedDetectorList ,
2425 PaginatedImageQueryList ,
2526)
3031
3132def is_valid_display_result (result : Any ) -> bool :
3233 """Is the image query result valid to display to the user?."""
33- if not isinstance (result , BinaryClassificationResult ) and not isinstance (result , CountingResult ):
34+ if (
35+ not isinstance (result , BinaryClassificationResult )
36+ and not isinstance (result , CountingResult )
37+ and not isinstance (result , MultiClassificationResult )
38+ ):
3439 return False
3540 if not is_valid_display_label (result .label ):
3641 return False
Original file line number Diff line number Diff line change 44
55def test_iq_is_confident (gl_experimental : ExperimentalApi ):
66 det = gl_experimental .get_or_create_detector ("Test" , "test_query" )
7- iq = gl_experimental .ask_async (det , image = "test/assets/dog.jpeg" , wait = 10 )
7+ iq = gl_experimental .ask_async (det , image = "test/assets/dog.jpeg" )
88 assert not iq_is_confident (iq , 0.9 )
99
1010
1111def test_iq_is_answered (gl_experimental : ExperimentalApi ):
1212 det = gl_experimental .get_or_create_detector ("Test" , "test_query" )
13- iq = gl_experimental .ask_async (det , image = "test/assets/dog.jpeg" , wait = 10 )
13+ iq = gl_experimental .ask_async (det , image = "test/assets/dog.jpeg" )
1414 assert not iq_is_answered (iq )
You can’t perform that action at this time.
0 commit comments