提交 f28a033d 编写于 作者: G Guanghua Yu 提交者: qingqing01

fix big input size of shrink (#4090)

上级 e1c0f28a
......@@ -22,11 +22,13 @@ import argparse
import functools
from PIL import Image
def set_paddle_flags(**kwargs):
for key, value in kwargs.items():
if os.environ.get(key, None) is None:
os.environ[key] = str(value)
# NOTE(paddle-dev): All of these flags should be
# set before `import paddle`. Otherwise, it would
# not take any effect.
......@@ -34,7 +36,6 @@ set_paddle_flags(
FLAGS_eager_delete_tensor_gb=0, # enable GC to save memory
)
import paddle.fluid as fluid
import reader
from pyramidbox import PyramidBox
......@@ -315,6 +316,8 @@ def get_shrink(height, width):
max_shrink = max_shrink - 0.4
elif max_shrink >= 5:
max_shrink = max_shrink - 0.5
elif max_shrink <= 0.1:
max_shrink = 0.1
shrink = max_shrink if max_shrink < 1 else 1
return shrink, max_shrink
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册