Spaces:
Sleeping
Sleeping
Update codes.py
Browse files
codes.py
CHANGED
|
@@ -150,10 +150,11 @@ def transform_standard_points(Affine_mat, x,y):
|
|
| 150 |
|
| 151 |
def wrap_points(img, x_source, y_source, l=1):
|
| 152 |
for i in range(len(y_source)):
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
|
|
|
| 157 |
|
| 158 |
|
| 159 |
def wrap_imge_cropped(Affine_mtrx, source_img, dim1=224, dim2=128):
|
|
|
|
| 150 |
|
| 151 |
def wrap_points(img, x_source, y_source, l=1):
|
| 152 |
for i in range(len(y_source)):
|
| 153 |
+
x0 = x_source[i].int()
|
| 154 |
+
y0 = y_source[i].int()
|
| 155 |
+
if (x0<dim) and (x0>0) and (y0<dim) and (y0>0):
|
| 156 |
+
img[:,:,x0-l:x0+l,y0-l:y0+l] = 0
|
| 157 |
+
return img
|
| 158 |
|
| 159 |
|
| 160 |
def wrap_imge_cropped(Affine_mtrx, source_img, dim1=224, dim2=128):
|