Skip to content

Instantly share code, notes, and snippets.

@Jargon4072
Created September 25, 2019 19:30
Show Gist options
  • Save Jargon4072/9f604866f7d512466a7bd2d87061714e to your computer and use it in GitHub Desktop.
Save Jargon4072/9f604866f7d512466a7bd2d87061714e to your computer and use it in GitHub Desktop.
Yolov3_medium_4
def main():
# load our input image and grab its spatial dimensions
image = cv2.imread("./test1.jpg")
labelsPath="yolo_v3/coco.names"
cfgpath="yolo_v3/yolov3.cfg"
wpath="yolo_v3/yolov3.weights"
Lables=get_labels(labelsPath)
CFG=get_config(cfgpath)
Weights=get_weights(wpath)
nets=load_model(CFG,Weights)
Colors=get_colors(Lables)
res=get_predection(image,nets,Lables,Colors)
# image=cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
# show the output image
cv2.imshow("Image", res)
cv2.waitKey()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment