Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ import streamlit as st
|
|
| 9 |
import plotly.graph_objects as go
|
| 10 |
from PIL import Image
|
| 11 |
from model import run_image_enhancement
|
|
|
|
| 12 |
# ---------------------------------------------------------
|
| 13 |
# SAFE HELPER
|
| 14 |
# ---------------------------------------------------------
|
|
@@ -173,5 +174,24 @@ def main():
|
|
| 173 |
# ---------------------------------------------------------
|
| 174 |
# RUN
|
| 175 |
# ---------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
if __name__ == "__main__":
|
| 177 |
main()
|
|
|
|
| 9 |
import plotly.graph_objects as go
|
| 10 |
from PIL import Image
|
| 11 |
from model import run_image_enhancement
|
| 12 |
+
from your_pipeline_file import enhancement_pipeline
|
| 13 |
# ---------------------------------------------------------
|
| 14 |
# SAFE HELPER
|
| 15 |
# ---------------------------------------------------------
|
|
|
|
| 174 |
# ---------------------------------------------------------
|
| 175 |
# RUN
|
| 176 |
# ---------------------------------------------------------
|
| 177 |
+
def run_image_enhancement(img_np):
|
| 178 |
+
|
| 179 |
+
# call your existing pipeline
|
| 180 |
+
result = enhancement_pipeline(img_np, {
|
| 181 |
+
"gamma_enable": True,
|
| 182 |
+
"gamma": 1.0,
|
| 183 |
+
"clahe_enable": True,
|
| 184 |
+
"clahe_clip": 2.0,
|
| 185 |
+
"denoise_enable": True,
|
| 186 |
+
"denoise_h": 10,
|
| 187 |
+
"sharpen_enable": True
|
| 188 |
+
})
|
| 189 |
+
|
| 190 |
+
return {
|
| 191 |
+
"result": result,
|
| 192 |
+
"sequential_time": 0.0,
|
| 193 |
+
"parallel_time": 0.0,
|
| 194 |
+
"speedup": 1.0
|
| 195 |
+
}
|
| 196 |
if __name__ == "__main__":
|
| 197 |
main()
|