Adding the string because the image is working
Browse files
    	
        app.py
    CHANGED
    
    | @@ -73,7 +73,19 @@ def detect_objects(model_name,url_input,image_input,threshold): | |
| 73 |  | 
| 74 | 
             
                    render = render_result(model=model, image=image_input, result=results[0])
         | 
| 75 |  | 
| 76 | 
            -
                     | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 77 | 
             
                else:
         | 
| 78 |  | 
| 79 | 
             
                    #Extract model and feature extractor
         | 
|  | |
| 73 |  | 
| 74 | 
             
                    render = render_result(model=model, image=image_input, result=results[0])
         | 
| 75 |  | 
| 76 | 
            +
                    final_str = ""
         | 
| 77 | 
            +
                    final_str_abv = ""
         | 
| 78 | 
            +
                    final_str_else = ""
         | 
| 79 | 
            +
             | 
| 80 | 
            +
                    for r in results:
         | 
| 81 | 
            +
                        if r.boxes.conf >= threshold:
         | 
| 82 | 
            +
                            final_str_abv =+ str(r.boxes) + "\n"
         | 
| 83 | 
            +
                        else:
         | 
| 84 | 
            +
                            final_str_else =+ str(r.boxes) + "\n"
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                    final_str = "{:*^50}\n".format("ABOVE THRESHOLD OR EQUAL") + final_str_abv + "\n{:*^50}\n".format("BELOW THRESHOLD")+final_str_else
         | 
| 87 | 
            +
             | 
| 88 | 
            +
                    return render, final_str
         | 
| 89 | 
             
                else:
         | 
| 90 |  | 
| 91 | 
             
                    #Extract model and feature extractor
         |