提交 557cdf5e 编写于 作者: 走神的阿圆's avatar 走神的阿圆

delete file after predict

上级 f9523774
......@@ -18,7 +18,7 @@ import time
import os
import base64
import logging
import shutil
import glob
cv_module_method = {
"vgg19_imagenet": "predict_classification",
......@@ -140,7 +140,7 @@ def predict_mask(module, input_img, id, batch_size, extra=None, r_img=True):
global use_gpu
method_name = module.desc.attr.map.data['default_signature'].s
predict_method = getattr(module, method_name)
data_len = len(input_img)
data_len = len(input_img) if input_img is not None else 0
results = []
try:
data = {}
......@@ -168,6 +168,11 @@ def predict_mask(module, input_img, id, batch_size, extra=None, r_img=True):
for index in range(len(results)):
results[index]["path"] = ""
results_pack = results
str_id = id + "*"
files_deleted = glob.glob(str_id)
for path in files_deleted:
if os.path.exists(path):
os.remove(path)
else:
input_img = input_img.get("image", [])
for index in range(len(input_img)):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册