mirror of
https://github.com/Ascend/ascend_community_projects.git
synced 2025-09-26 20:01:17 +08:00
fix modify README.md
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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',
|
||||
|
@@ -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]
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user