DeclK commited on
Commit
21f47eb
·
2 Parent(s): 6b24cb12d6b584

Merge branch 'main' of https://huggingface.co/spaces/DeclK/pose into main

Browse files
Files changed (2) hide show
  1. app.py +6 -6
  2. main.py +6 -6
app.py CHANGED
@@ -12,16 +12,16 @@ import cv2
12
  import gradio as gr
13
 
14
  def concat(img1, img2, height=1080):
15
- w1, h1, _ = img1.shape
16
- w2, h2, _ = img2.shape
17
 
18
  # Calculate the scaling factor for each image
19
- scale1 = height / img1.shape[1]
20
- scale2 = height / img2.shape[1]
21
 
22
  # Resize the images
23
- img1 = cv2.resize(img1, (int(h1*scale1), int(w1*scale1)))
24
- img2 = cv2.resize(img2, (int(h2*scale2), int(w2*scale2)))
25
 
26
  # Concatenate the images horizontally
27
  image = cv2.hconcat([img1, img2])
 
12
  import gradio as gr
13
 
14
  def concat(img1, img2, height=1080):
15
+ h1, w1, _ = img1.shape
16
+ h2, w2, _ = img2.shape
17
 
18
  # Calculate the scaling factor for each image
19
+ scale1 = height / img1.shape[0]
20
+ scale2 = height / img2.shape[0]
21
 
22
  # Resize the images
23
+ img1 = cv2.resize(img1, (int(w1*scale1), int(h1*scale1)))
24
+ img2 = cv2.resize(img2, (int(w2*scale2), int(h2*scale2)))
25
 
26
  # Concatenate the images horizontally
27
  image = cv2.hconcat([img1, img2])
main.py CHANGED
@@ -18,16 +18,16 @@ def parse_args():
18
  return parser.parse_args()
19
 
20
  def concat(img1, img2, height=1080):
21
- w1, h1, _ = img1.shape
22
- w2, h2, _ = img2.shape
23
 
24
  # Calculate the scaling factor for each image
25
- scale1 = height / img1.shape[1]
26
- scale2 = height / img2.shape[1]
27
 
28
  # Resize the images
29
- img1 = cv2.resize(img1, (int(h1*scale1), int(w1*scale1)))
30
- img2 = cv2.resize(img2, (int(h2*scale2), int(w2*scale2)))
31
 
32
  # Concatenate the images horizontally
33
  image = cv2.hconcat([img1, img2])
 
18
  return parser.parse_args()
19
 
20
  def concat(img1, img2, height=1080):
21
+ h1, w1, _ = img1.shape
22
+ h2, w2, _ = img2.shape
23
 
24
  # Calculate the scaling factor for each image
25
+ scale1 = height / img1.shape[0]
26
+ scale2 = height / img2.shape[0]
27
 
28
  # Resize the images
29
+ img1 = cv2.resize(img1, (int(w1*scale1), int(h1*scale1)))
30
+ img2 = cv2.resize(img2, (int(w2*scale2), int(h2*scale2)))
31
 
32
  # Concatenate the images horizontally
33
  image = cv2.hconcat([img1, img2])