-
Notifications
You must be signed in to change notification settings - Fork 53
/
Main.py
53 lines (44 loc) · 2.1 KB
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
# --------------------------------------
# @Time : 2018/5/16$ 17:17$
# @Author : KOD Chen
# @Email : 821237536@qq.com
# @File : Main$.py
# Description :YOLO_v2主函数.
# --------------------------------------
import numpy as np
import tensorflow as tf
import cv2
from PIL import Image
from YOLO_v2.model_darknet19 import darknet
from YOLO_v2.decode import decode
from YOLO_v2.utils import preprocess_image, postprocess, draw_detection
from YOLO_v2.config import anchors, class_names
def main():
input_size = (416,416)
image_file = './yolo2_data/car.jpg'
image = cv2.imread(image_file)
image_shape = image.shape[:2] #只取wh,channel=3不取