File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 44import sys
55
66import requests
7- from PIL import Image
87from numpy import ndarray
8+ from PIL import Image
99
1010from roboflow .config import API_URL , CLIP_FEATURIZE_URL , DEMO_KEYS
1111from roboflow .core .project import Project
@@ -332,12 +332,7 @@ def active_learning(
332332
333333 predictions = inference_model .predict (image ).json ()["predictions" ]
334334 # collect all predictions to return to user at end
335- prediction_results .append (
336- {
337- "image" :image ,
338- "predictions" :predictions
339- }
340- )
335+ prediction_results .append ({"image" : image , "predictions" : predictions })
341336
342337 # compare object and class count of predictions if enabled, continue if not enough occurances
343338 if not count_comparisons (
@@ -383,9 +378,13 @@ def active_learning(
383378 print (" >> image uploaded!" )
384379 upload_project .upload (image , num_retry_uploads = 3 )
385380 break
386-
381+
387382 # return predictions with filenames if globbed images from dir, otherwise return latest prediction result
388- return prediction_results if type (raw_data_location ) is not ndarray else prediction_results [- 1 ]["predictions" ]
383+ return (
384+ prediction_results
385+ if type (raw_data_location ) is not ndarray
386+ else prediction_results [- 1 ]["predictions" ]
387+ )
389388
390389 def __str__ (self ):
391390 projects = self .projects ()
You can’t perform that action at this time.
0 commit comments