endrol commited on
Commit
c7b35f4
·
1 Parent(s): fac67ac

add dce model

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -6,9 +6,17 @@ import time
6
  import os
7
  from PIL import Image
8
 
9
- # Get API endpoints from environment
10
  SR_API = os.getenv("sr_api")
11
  ENHANCE_API = os.getenv("enhance_api")
 
 
 
 
 
 
 
 
12
 
13
  def apply_super_resolution(input_image, scale_factor, tile_size, api_choice):
14
  """Apply super-resolution to input image"""
@@ -16,7 +24,7 @@ def apply_super_resolution(input_image, scale_factor, tile_size, api_choice):
16
  return None, "❌ Please upload an image first", gr.update(visible=False)
17
 
18
  # Select API endpoint based on user choice
19
- api_endpoint = SR_API if api_choice == "SR API" else ENHANCE_API
20
 
21
  if not api_endpoint:
22
  return None, f"❌ {api_choice} endpoint not configured", gr.update(visible=False)
@@ -86,7 +94,7 @@ def main():
86
  gr.Markdown("### Enhancement Settings")
87
 
88
  api_dropdown = gr.Dropdown(
89
- choices=["SR API", "ENHANCE API"],
90
  value="SR API",
91
  label="API Choice",
92
  info="Choose which enhancement API to use"
 
6
  import os
7
  from PIL import Image
8
 
9
+
10
  SR_API = os.getenv("sr_api")
11
  ENHANCE_API = os.getenv("enhance_api")
12
+ ZERODCE_API = os.getenv("zerodce_api")
13
+
14
+ # Get API endpoints from environment
15
+ API_ENDPOINTS = {
16
+ "SR API": SR_API,
17
+ "ENHANCE API": ENHANCE_API,
18
+ "ZERODCE API": ZERODCE_API
19
+ }
20
 
21
  def apply_super_resolution(input_image, scale_factor, tile_size, api_choice):
22
  """Apply super-resolution to input image"""
 
24
  return None, "❌ Please upload an image first", gr.update(visible=False)
25
 
26
  # Select API endpoint based on user choice
27
+ api_endpoint = API_ENDPOINTS[api_choice]
28
 
29
  if not api_endpoint:
30
  return None, f"❌ {api_choice} endpoint not configured", gr.update(visible=False)
 
94
  gr.Markdown("### Enhancement Settings")
95
 
96
  api_dropdown = gr.Dropdown(
97
+ choices=["SR API", "ENHANCE API", "ZERODCE API"],
98
  value="SR API",
99
  label="API Choice",
100
  info="Choose which enhancement API to use"