Fix ViT-5 model prediction output and logging
Browse files
    	
        app.py
    CHANGED
    
    | @@ -201,9 +201,9 @@ def predict_image(img, confidence_threshold): | |
| 201 |  | 
| 202 | 
             
                try:
         | 
| 203 | 
             
                    prediction_5 = clf_5(img_pilvits)
         | 
| 204 | 
            -
                    result_5 = {pred['label']: pred['score'] for pred in  | 
| 205 | 
             
                    result_5output = [5, 'ViT-base Newcomer', result_5['Realism'], result_5['Deepfake']]
         | 
| 206 | 
            -
                    print( | 
| 207 | 
             
                    # Ensure the result dictionary contains all class names
         | 
| 208 | 
             
                    for class_name in class_names_5:
         | 
| 209 | 
             
                        if class_name not in result_5:
         | 
|  | |
| 201 |  | 
| 202 | 
             
                try:
         | 
| 203 | 
             
                    prediction_5 = clf_5(img_pilvits)
         | 
| 204 | 
            +
                    result_5 = {pred['label']: pred['score'] for pred in prediction_5}
         | 
| 205 | 
             
                    result_5output = [5, 'ViT-base Newcomer', result_5['Realism'], result_5['Deepfake']]
         | 
| 206 | 
            +
                    print(result_5output)
         | 
| 207 | 
             
                    # Ensure the result dictionary contains all class names
         | 
| 208 | 
             
                    for class_name in class_names_5:
         | 
| 209 | 
             
                        if class_name not in result_5:
         | 
 
			
