HaruthaiAi commited on
Commit
43304a1
·
verified ·
1 Parent(s): d5bc519

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,7 +1,13 @@
1
  import gradio as gr
 
 
2
 
3
  def analyze_brushstroke(image):
4
- return "AI is analyzing the brushstroke of Van Gogh's style..."
 
 
 
 
5
 
6
- demo = gr.Interface(fn=analyze_brushstroke, inputs="image", outputs="text")
7
  demo.launch()
 
1
  import gradio as gr
2
+ import numpy as np
3
+ import cv2
4
 
5
  def analyze_brushstroke(image):
6
+ # แปลงภาพเป็นขาวดำ และตรวจจับขอบภาพ (Edge Detection)
7
+ gray = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
8
+ edges = cv2.Canny(gray, 100, 200)
9
+
10
+ return edges # คืนค่าภาพที่ประมวลผลแล้ว
11
 
12
+ demo = gr.Interface(fn=analyze_brushstroke, inputs="image", outputs="image")
13
  demo.launch()