Commit
·
3c53d13
verified
·
0
Parent(s):
initial commit
Browse files- .gitattributes +35 -0
- README.md +14 -0
- app.py +35 -0
- requirements.txt +1 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: MutimodalVisionAssistant
|
| 3 |
+
emoji: 🏢
|
| 4 |
+
colorFrom: yellow
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.25.1
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
short_description: Multimodal AI for Visual Impairment Support
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This is a simple Gradio app that handles image upload, webcam capture, and voice recording.
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
# Define a function to handle image upload and webcam capture.
|
| 6 |
+
def handle_image(image):
|
| 7 |
+
return "Image received!", image # Return a confirmation message and the image itself
|
| 8 |
+
|
| 9 |
+
# Define a function to handle voice recording.
|
| 10 |
+
def handle_voice(audio):
|
| 11 |
+
return "Voice recording received!", audio # Return a confirmation message and the audio itself
|
| 12 |
+
|
| 13 |
+
# Create a Gradio interface without the name and output boxes.
|
| 14 |
+
with gr.Blocks() as demo:
|
| 15 |
+
# Add an image upload button
|
| 16 |
+
image_upload = gr.Image(label="Upload an Image", sources="upload")
|
| 17 |
+
# Add a webcam capture button
|
| 18 |
+
image_webcam = gr.Image(label="Take a Picture", sources="webcam")
|
| 19 |
+
# Add a button to record voice using the microphone
|
| 20 |
+
voice_record = gr.Audio(label="Record Voice", sources="microphone")
|
| 21 |
+
|
| 22 |
+
# Add a column on the right to display the uploaded/captured image
|
| 23 |
+
with gr.Column():
|
| 24 |
+
image_display = gr.Image(label="Uploaded/Captured Image", interactive=False)
|
| 25 |
+
audio_display = gr.Audio(label="Recorded Voice", interactive=False) # Add an audio display component
|
| 26 |
+
|
| 27 |
+
# Connect the image upload button to the handle_image function
|
| 28 |
+
image_upload.change(fn=handle_image, inputs=image_upload, outputs=[gr.Textbox(), image_display])
|
| 29 |
+
# Connect the webcam capture button to the handle_image function
|
| 30 |
+
image_webcam.change(fn=handle_image, inputs=image_webcam, outputs=[gr.Textbox(), image_display])
|
| 31 |
+
# Connect the voice recording button to the handle_voice function
|
| 32 |
+
voice_record.change(fn=handle_voice, inputs=voice_record, outputs=[gr.Textbox(), audio_display])
|
| 33 |
+
|
| 34 |
+
if __name__ == "__main__":
|
| 35 |
+
demo.launch(show_error=True)
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
numpy
|