Chanlefe commited on
Commit
cee92ec
·
verified ·
1 Parent(s): 6554f18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -5,8 +5,11 @@ import gradio as gr
5
  import pytesseract
6
 
7
  # Load model and processor
8
- model = AutoModelForImageClassification.from_pretrained("google/siglip2-base-patch16-naflex")
9
- processor = AutoProcessor.from_pretrained("google/siglip2-base-patch16-naflex")
 
 
 
10
  labels = model.config.id2label
11
 
12
  # Classify meme and extract text
@@ -25,7 +28,8 @@ def classify_meme(image: Image.Image):
25
  "Predictions": predictions,
26
  "Extracted Text": extracted_text.strip()
27
  }
28
-
 
29
  # Gradio interface
30
  demo = gr.Interface(
31
  fn=classify_meme,
 
5
  import pytesseract
6
 
7
  # Load model and processor
8
+ model = AutoModelForImageClassification.from_pretrained("Chanlefe/SigLIP2_77")
9
+
10
+ processor = AutoProcessor.from_pretrained("Chanlefe/SigLIP2_77")
11
+
12
+
13
  labels = model.config.id2label
14
 
15
  # Classify meme and extract text
 
28
  "Predictions": predictions,
29
  "Extracted Text": extracted_text.strip()
30
  }
31
+ print("Extracted Text:", extracted_text)
32
+ print("Predictions:", predictions)
33
  # Gradio interface
34
  demo = gr.Interface(
35
  fn=classify_meme,