sahadev10 commited on
Commit
000f10f
·
verified ·
1 Parent(s): 4f5a562

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -63,8 +63,6 @@
63
 
64
  # iface.launch()
65
 
66
-
67
-
68
  import gradio as gr
69
  import torch
70
  import numpy as np
@@ -86,7 +84,7 @@ model_path = 'dress_model.pkl'
86
  with open(model_path, 'rb') as f:
87
  G = legacy.load_network_pkl(f)['G_ema'].to(device)
88
 
89
- # Global variable to store user_id (per IP/session) — not ideal for production
90
  user_ids = {}
91
 
92
  def mix_styles(image1_path, image2_path, styles_to_mix):
@@ -129,7 +127,6 @@ def send_to_backend(image_buffer, request: gr.Request):
129
  files = {'file': ('generated_image.png', image_buffer, 'image/png')}
130
  url = f"https://361d-103-40-74-78.ngrok-free.app/customisation/upload/{user_id}"
131
 
132
-
133
  response = requests.post(url, files=files)
134
 
135
  if response.status_code == 201:
@@ -176,4 +173,3 @@ iface.launch()
176
 
177
 
178
 
179
-
 
63
 
64
  # iface.launch()
65
 
 
 
66
  import gradio as gr
67
  import torch
68
  import numpy as np
 
84
  with open(model_path, 'rb') as f:
85
  G = legacy.load_network_pkl(f)['G_ema'].to(device)
86
 
87
+ # Global dictionary to store user_id based on IP
88
  user_ids = {}
89
 
90
  def mix_styles(image1_path, image2_path, styles_to_mix):
 
127
  files = {'file': ('generated_image.png', image_buffer, 'image/png')}
128
  url = f"https://361d-103-40-74-78.ngrok-free.app/customisation/upload/{user_id}"
129
 
 
130
  response = requests.post(url, files=files)
131
 
132
  if response.status_code == 201:
 
173
 
174
 
175