Spaces:
Running
Running
limit image size
Browse files
patch
CHANGED
@@ -113,3 +113,16 @@ index 500e53c..4061dbe 100644
|
|
113 |
model = init_segmentor(config_file, checkpoint_file).cuda()
|
114 |
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
model = init_segmentor(config_file, checkpoint_file).cuda()
|
114 |
|
115 |
|
116 |
+
diff --git a/annotator/util.py b/annotator/util.py
|
117 |
+
index 7cde937..10a6d58 100644
|
118 |
+
--- a/annotator/util.py
|
119 |
+
+++ b/annotator/util.py
|
120 |
+
@@ -25,7 +25,7 @@ def resize_image(input_image, resolution):
|
121 |
+
H, W, C = input_image.shape
|
122 |
+
H = float(H)
|
123 |
+
W = float(W)
|
124 |
+
- k = float(resolution) / min(H, W)
|
125 |
+
+ k = float(resolution) / max(H, W)
|
126 |
+
H *= k
|
127 |
+
W *= k
|
128 |
+
H = int(np.round(H / 64.0)) * 64
|