tasal9 commited on
Commit
70e0084
·
verified ·
1 Parent(s): 1f30d2a

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +6 -9
  2. app.py +83 -36
README.md CHANGED
@@ -11,13 +11,10 @@ pinned: false
11
 
12
  # ZamVision
13
 
14
- A lightweight public demo of **ZamVision**, a smart visual assistant for OCR, translation, and image understanding.
15
 
16
- ## Demo focus
17
- - image upload
18
- - OCR workflow preview
19
- - translation flow preview
20
- - visual assistant UX
21
-
22
- ## Notes
23
- This demo can later be connected to OCR, multilingual translation, and computer vision pipelines.
 
11
 
12
  # ZamVision
13
 
14
+ A polished public demo of **ZamVision**, a smart visual assistant for OCR, translation, and image understanding.
15
 
16
+ ## Highlights
17
+ - image upload workflow
18
+ - OCR preview
19
+ - translation-style experience
20
+ - visual AI branding
 
 
 
app.py CHANGED
@@ -1,60 +1,107 @@
1
  import gradio as gr
2
 
 
3
  def analyze_image(image, task, target_language):
4
  if image is None:
5
- return "Please upload an image first."
6
 
7
  width, height = image.size
8
 
9
- return f"""Task: {task}
10
- Target language: {target_language}
 
 
 
 
11
 
12
- Demo analysis:
13
  - Image received successfully
14
- - Size: {width} x {height}
15
- - This is a placeholder public demo for ZamVision
16
 
17
- In the full ZamVision app, this output can include:
18
  - OCR text extraction
19
  - document translation
20
  - object recognition
21
- - visual explanation
22
  """
23
 
24
- with gr.Blocks(title="ZamVision") as demo:
25
- gr.Markdown(
26
- """
27
- # ZamVision
28
- ### Smart vision demo for OCR, translation, and image understanding
29
- Upload an image to preview the ZamVision experience.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  """
31
- )
32
 
33
- image_input = gr.Image(type="pil", label="Upload image")
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  with gr.Row():
36
- task = gr.Dropdown(
37
- choices=["OCR", "Document Translation", "Object Recognition", "Visual Explanation"],
38
- value="OCR",
39
- label="Task"
40
- )
41
- target_language = gr.Dropdown(
42
- choices=["English", "Pashto", "Dari"],
43
- value="English",
44
- label="Target language"
45
- )
46
-
47
- output = gr.Textbox(label="Result", lines=12)
48
- btn = gr.Button("Analyze")
 
 
 
 
49
  btn.click(analyze_image, inputs=[image_input, task, target_language], outputs=output)
50
 
51
- gr.Markdown(
52
- """
53
- ## About this demo
54
- ZamVision is designed as a practical visual AI assistant.
55
- This lightweight public version demonstrates the interface and workflow.
56
- """
57
- )
58
 
59
  if __name__ == "__main__":
60
  demo.launch()
 
1
  import gradio as gr
2
 
3
+
4
  def analyze_image(image, task, target_language):
5
  if image is None:
6
+ return "Please upload an image to continue."
7
 
8
  width, height = image.size
9
 
10
+ summary = f"""
11
+ ### Vision Result
12
+
13
+ **Task:** {task}
14
+ **Target language:** {target_language}
15
+ **Image size:** {width} × {height}
16
 
17
+ ### Demo analysis
18
  - Image received successfully
19
+ - ZamVision workflow triggered
20
+ - Placeholder output generated for public demo
21
 
22
+ ### Future capabilities
23
  - OCR text extraction
24
  - document translation
25
  - object recognition
26
+ - image explanation
27
  """
28
 
29
+ return summary
30
+
31
+
32
+ css = """
33
+ .gradio-container {
34
+ background: linear-gradient(180deg, #08121d 0%, #10263c 100%);
35
+ }
36
+ .hero {
37
+ text-align: center;
38
+ padding: 28px 16px 10px 16px;
39
+ }
40
+ .hero h1 {
41
+ font-size: 2.4rem;
42
+ margin-bottom: 0.35rem;
43
+ }
44
+ .hero p {
45
+ font-size: 1.05rem;
46
+ opacity: 0.92;
47
+ }
48
+ .badges {
49
+ display: flex;
50
+ justify-content: center;
51
+ gap: 10px;
52
+ flex-wrap: wrap;
53
+ margin-top: 14px;
54
+ }
55
+ .badge {
56
+ background: #11324a;
57
+ border: 1px solid #27506a;
58
+ color: #e5f4ff;
59
+ padding: 8px 12px;
60
+ border-radius: 999px;
61
+ font-size: 0.9rem;
62
+ }
63
  """
 
64
 
65
+
66
+ with gr.Blocks(title="ZamVision", css=css, theme=gr.themes.Soft()) as demo:
67
+ gr.HTML("""
68
+ <div class="hero">
69
+ <h1>👁️ ZamVision</h1>
70
+ <p>Smart visual AI for OCR, translation, and image understanding.</p>
71
+ <div class="badges">
72
+ <div class="badge">OCR</div>
73
+ <div class="badge">Translation</div>
74
+ <div class="badge">Image Understanding</div>
75
+ <div class="badge">Public Demo</div>
76
+ </div>
77
+ </div>
78
+ """)
79
 
80
  with gr.Row():
81
+ with gr.Column(scale=1):
82
+ image_input = gr.Image(type="pil", label="Upload image")
83
+ task = gr.Dropdown(
84
+ choices=["OCR", "Document Translation", "Object Recognition", "Visual Explanation"],
85
+ value="OCR",
86
+ label="Task"
87
+ )
88
+ target_language = gr.Dropdown(
89
+ choices=["English", "Pashto", "Dari"],
90
+ value="English",
91
+ label="Target language"
92
+ )
93
+ btn = gr.Button("Analyze Image", variant="primary")
94
+
95
+ with gr.Column(scale=1):
96
+ output = gr.Markdown(label="Vision Output")
97
+
98
  btn.click(analyze_image, inputs=[image_input, task, target_language], outputs=output)
99
 
100
+ gr.Markdown("""
101
+ ### About this demo
102
+ ZamVision showcases a practical visual workflow designed for OCR, translation, and image-based assistance.
103
+ """)
104
+
 
 
105
 
106
  if __name__ == "__main__":
107
  demo.launch()