wizzseen commited on
Commit
3096da3
·
verified ·
1 Parent(s): ba3274d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -3,6 +3,8 @@ import shutil
3
  import gradio as gr
4
  from google.colab import files
5
  from PIL import Image
 
 
6
 
7
  def process_images(cloth_image, origin_image):
8
  # Convert numpy arrays to PIL images
@@ -23,7 +25,8 @@ def process_images(cloth_image, origin_image):
23
  print("saved")
24
  # Run your main.py script (assuming it's in the same directory)
25
  # Note: You might need to adjust the command based on your actual script's requirements
26
- !python main.py
 
27
  print("might run")
28
  # Return the final image
29
  final_image_path = os.path.join(input_dir, 'finalimg.png')
 
3
  import gradio as gr
4
  from google.colab import files
5
  from PIL import Image
6
+ import subprocess
7
+
8
 
9
  def process_images(cloth_image, origin_image):
10
  # Convert numpy arrays to PIL images
 
25
  print("saved")
26
  # Run your main.py script (assuming it's in the same directory)
27
  # Note: You might need to adjust the command based on your actual script's requirements
28
+ command = ["python", "main.py"]
29
+ subprocess.run(command, check=True)
30
  print("might run")
31
  # Return the final image
32
  final_image_path = os.path.join(input_dir, 'finalimg.png')