Canyu commited on
Commit
93ddd94
·
1 Parent(s): 26ebe16
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -70,21 +70,19 @@ def process_image_4(image_path, prompt):
70
 
71
  w, h = image.size
72
 
73
- coor_point = torch.zeros((1,5,2)).to(torch.float32)
74
- point_labels = torch.zeros((1,5,1)).to(torch.float32)
75
 
76
  image = image.resize((768, 768), Image.LANCZOS).convert('RGB')
77
- to_tensor = transforms.ToTensor()
78
- image = (to_tensor(image) - 0.5) * 2
79
 
80
  cur_input = {
81
- 'input_images': image.unsqueeze(0),
82
- 'original_size': torch.tensor([[w,h]]),
83
- 'target_size': torch.tensor([[768, 768]]),
84
  'prompt': [cur_p],
85
  'coor_point': coor_point,
86
  'point_labels': point_labels,
87
- 'generator': generator
88
  }
89
  inputs.append(cur_input)
90
 
 
70
 
71
  w, h = image.size
72
 
73
+ coor_point = []
74
+ point_labels = []
75
 
76
  image = image.resize((768, 768), Image.LANCZOS).convert('RGB')
77
+
 
78
 
79
  cur_input = {
80
+ 'input_images': image,
81
+ 'original_size': [[w,h]],
82
+ 'target_size': [[768, 768]],
83
  'prompt': [cur_p],
84
  'coor_point': coor_point,
85
  'point_labels': point_labels,
 
86
  }
87
  inputs.append(cur_input)
88