fix modify README.md

This commit is contained in:
jtc
2022-09-24 22:10:29 +08:00
parent cd91dc392a
commit 90aa8100b8
4 changed files with 5 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ import glob
import cv2
from StreamManagerApi import StreamManagerApi, MxDataInput
import numpy as np
from utils import xyxy2xywh,is_legal
from utils import xyxy2xywh, is_legal
from plots import box_label, colors

View File

@@ -19,7 +19,7 @@ import glob
import cv2
from StreamManagerApi import StreamManagerApi, MxDataInput
import numpy as np
from utils import preprocess, scale_coords, xyxy2xywh,is_legal
from utils import preprocess, scale_coords, xyxy2xywh, is_legal
from plots import box_label, colors
names = ['non_conduct', 'abrasion_mark', 'corner_leak', 'orange_peel', 'leak', 'jet_flow', 'paint_bubble', 'pit',

View File

@@ -18,7 +18,7 @@ import cv2
from StreamManagerApi import StreamManagerApi, MxDataInput
import numpy as np
from plots import box_label, colors
from utils import preprocess, scale_coords, xyxy2xywh,is_legal
from utils import preprocess, scale_coords, xyxy2xywh, is_legal
names = ['non_conduct', 'abrasion_mark', 'corner_leak', 'orange_peel', 'leak', 'jet_flow', 'paint_bubble', 'pit',
'motley', 'dirty_spot']
@@ -43,7 +43,6 @@ if __name__ == '__main__':
ORI_IMG_PATH = "test.png"
is_legal(ORI_IMG_PATH)
# read image
ori_img = cv2.imread(ORI_IMG_PATH)
h0, w0 = ori_img.shape[:2]

View File

@@ -17,7 +17,6 @@ import numpy as np
import cv2
def preprocess(im, new_shape, color=(114, 114, 114)):
# Resize and pad image while meeting stride-multiple constraints
shape = im.shape[:2] # current shape [height, width]
@@ -85,6 +84,7 @@ def is_jpg(image_path):
return False
return True
def is_legal(image_path):
if not os.path.exists(image_path):
print("The test image does not exist.")
@@ -94,4 +94,4 @@ def is_legal(image_path):
exit()
if not is_jpg(image_path):
print("Please enter a JPG image")
exit()
exit()