Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files
README.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: GERD Lightweight ViT Classifier
|
| 3 |
-
emoji: 🏥
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: green
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 4.0.
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
# GERD Lightweight Vision Transformer Classifier
|
| 13 |
-
|
| 14 |
-
This is a lightweight Vision Transformer model for GERD classification.
|
| 15 |
-
|
| 16 |
-
## Model Architecture
|
| 17 |
-
|
| 18 |
-
- **Image size**: 224×224×3
|
| 19 |
-
- **Patch size**: 8×8
|
| 20 |
-
- **Projection dimension**: 64
|
| 21 |
-
- **Transformer layers**: 4
|
| 22 |
-
- **Attention heads**: 4
|
| 23 |
-
- **MLP head units**: [128, 64]
|
| 24 |
-
|
| 25 |
-
## Usage
|
| 26 |
-
|
| 27 |
-
Upload an image and the model will classify it into one of the predefined classes.
|
| 28 |
-
|
| 29 |
-
## Preprocessing
|
| 30 |
-
|
| 31 |
-
Images are:
|
| 32 |
-
|
| 33 |
-
1. Resized to 224×224
|
| 34 |
-
2. Converted to RGB
|
| 35 |
-
3. Normalized to [0, 1] range
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: GERD Lightweight ViT Classifier
|
| 3 |
+
emoji: 🏥
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 4.0.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# GERD Lightweight Vision Transformer Classifier
|
| 13 |
+
|
| 14 |
+
This is a lightweight Vision Transformer model for GERD classification.
|
| 15 |
+
|
| 16 |
+
## Model Architecture
|
| 17 |
+
|
| 18 |
+
- **Image size**: 224×224×3
|
| 19 |
+
- **Patch size**: 8×8
|
| 20 |
+
- **Projection dimension**: 64
|
| 21 |
+
- **Transformer layers**: 4
|
| 22 |
+
- **Attention heads**: 4
|
| 23 |
+
- **MLP head units**: [128, 64]
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
Upload an image and the model will classify it into one of the predefined classes.
|
| 28 |
+
|
| 29 |
+
## Preprocessing
|
| 30 |
+
|
| 31 |
+
Images are:
|
| 32 |
+
|
| 33 |
+
1. Resized to 224×224
|
| 34 |
+
2. Converted to RGB
|
| 35 |
+
3. Normalized to [0, 1] range
|
app.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import numpy as np
|
| 3 |
-
import tensorflow as tf
|
| 4 |
-
from tensorflow.keras import layers as L, models
|
| 5 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# -----------------------------
|
| 9 |
# Model Architecture Components
|
|
@@ -168,4 +172,4 @@ with gr.Blocks() as demo:
|
|
| 168 |
|
| 169 |
# Launch without queue for direct API access
|
| 170 |
if __name__ == "__main__":
|
| 171 |
-
demo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from PIL import Image
|
| 2 |
+
from tensorflow.keras import layers as L, models
|
| 3 |
+
import tensorflow as tf
|
| 4 |
+
import numpy as np
|
| 5 |
+
import gradio as gr
|
| 6 |
import os
|
| 7 |
+
# Disable Gradio queue for direct REST API access
|
| 8 |
+
os.environ["GRADIO_QUEUE"] = "false"
|
| 9 |
+
os.environ["HF_HUB_DISABLE_GRADIO_QUEUE"] = "1"
|
| 10 |
+
|
| 11 |
|
| 12 |
# -----------------------------
|
| 13 |
# Model Architecture Components
|
|
|
|
| 172 |
|
| 173 |
# Launch without queue for direct API access
|
| 174 |
if __name__ == "__main__":
|
| 175 |
+
demo.launch()
|