Landing AI: tbs detetion pull request (revise image_open) (#184)

* open image using load_image

* format code

---------

Co-authored-by: QZStudio <1643006760@qq.com>
Co-authored-by: wenmeng.zwm <wenmeng.zwm@alibaba-inc.com>
This commit is contained in:
zhk1425734486
2023-03-15 21:21:24 +08:00
committed by GitHub
parent 8abfffc7e5
commit 9c2ca892ce
2 changed files with 3 additions and 2 deletions

View File

@@ -7,7 +7,6 @@ import cv2
import numpy as np
import PIL
import torch
import math
from modelscope.metainfo import Preprocessors
from modelscope.preprocessors import Preprocessor, load_image

View File

@@ -10,6 +10,8 @@ from matplotlib import pyplot as plt
from PIL import Image
from torchvision.ops.boxes import batched_nms, nms
from modelscope.preprocessors.image import load_image
plt.switch_backend('Agg')
@@ -365,7 +367,7 @@ def post_process(self, outputs, img_path):
except Exception:
return
image = Image.open(img_path)
image = load_image(img_path)
image_shape = np.array(np.shape(image)[0:2])
top_index = batch_detection[:,
4] * batch_detection[:,