paddle与opencv有冲突,故不再手动清理显存
This commit is contained in:
3
main.py
3
main.py
@@ -4,7 +4,6 @@ import traceback
|
|||||||
|
|
||||||
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
|
||||||
|
|
||||||
# import paddle
|
|
||||||
from auto_email.error_email import send_an_error_email
|
from auto_email.error_email import send_an_error_email
|
||||||
from config.log import LOGGING_CONFIG
|
from config.log import LOGGING_CONFIG
|
||||||
from photo_review.photo_review import main
|
from photo_review.photo_review import main
|
||||||
@@ -22,5 +21,3 @@ if __name__ == '__main__':
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
send_an_error_email(program_name='照片审核关键信息抽取脚本', error_name=repr(e), error_detail=traceback.format_exc())
|
send_an_error_email(program_name='照片审核关键信息抽取脚本', error_name=repr(e), error_detail=traceback.format_exc())
|
||||||
# 释放显存
|
|
||||||
# paddle.device.cuda.empty_cache()
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import json
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import pdb
|
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
@@ -55,7 +54,6 @@ def split_image(img_path, max_ratio=2.82, best_ration=1.41, overlap=0.05):
|
|||||||
split_result = []
|
split_result = []
|
||||||
# 打开图片
|
# 打开图片
|
||||||
img = open_image(img_path)
|
img = open_image(img_path)
|
||||||
pdb.set_trace()
|
|
||||||
# 获取图片的宽度和高度
|
# 获取图片的宽度和高度
|
||||||
height, width = img.shape[:2]
|
height, width = img.shape[:2]
|
||||||
# 计算宽高比
|
# 计算宽高比
|
||||||
|
|||||||
Reference in New Issue
Block a user