ASomeoneWhoInterestedWithAI commited on
Commit
68860ec
·
verified ·
1 Parent(s): cb2cf3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -11
app.py CHANGED
@@ -174,30 +174,25 @@ with gr.Blocks() as demo:
174
  """
175
  # 🧠 LookThem V8 - MNIST Fraction Engine Classifier
176
  ### 315K Parameters | **99.53% Validation Accuracy**
177
-
178
- Draw a single digit (0-9) in the sketchpad below to see how the fractional token gating engine analyzes structural patterns!
179
  """
180
  )
181
 
182
  with gr.Row():
183
  with gr.Column():
184
- # Create a 280x280 canvas for white drawing on black canvas background
185
- input_canvas = gr.Sketchpad(
186
- type="numpy",
187
- label="Draw Digit Here",
188
- layers=False,
189
  height=280,
190
- width=280
 
191
  )
192
  submit_btn = gr.Button("Classify Digit 🏎️", variant="primary")
193
- clear_btn = gr.Button("Clear Canvas")
194
 
195
  with gr.Column():
196
  output_label = gr.Label(num_top_classes=3, label="Top Probabilities")
197
 
198
- # Hook up action events
199
  submit_btn.click(fn=predict_digit, inputs=input_canvas, outputs=output_label)
200
- clear_btn.click(fn=lambda: None, outputs=input_canvas)
201
 
202
  if __name__ == "__main__":
203
  demo.launch(theme=gr.themes.Soft())
 
174
  """
175
  # 🧠 LookThem V8 - MNIST Fraction Engine Classifier
176
  ### 315K Parameters | **99.53% Validation Accuracy**
 
 
177
  """
178
  )
179
 
180
  with gr.Row():
181
  with gr.Column():
182
+ # Menggunakan gr.Paint dengan mode L (Luminance/Grayscale)
183
+ input_canvas = gr.Paint(
184
+ image_mode="L",
 
 
185
  height=280,
186
+ width=280,
187
+ brush=gr.components.image_editor.Brush(default_color="rgb(255, 255, 255)") # Kuas warna putih
188
  )
189
  submit_btn = gr.Button("Classify Digit 🏎️", variant="primary")
 
190
 
191
  with gr.Column():
192
  output_label = gr.Label(num_top_classes=3, label="Top Probabilities")
193
 
 
194
  submit_btn.click(fn=predict_digit, inputs=input_canvas, outputs=output_label)
195
+
196
 
197
  if __name__ == "__main__":
198
  demo.launch(theme=gr.themes.Soft())