def example3(): download('https://wws.lanzous.com/iwTNtj5vw6d', dir_pwd='./download/lanzou') # download('https://wws.lanzous.com/b01hh63kf', dir_pwd='./download/lanzou') # downer.down_dir_by_url('https://wws.lanzous.com/b01hh2zve', dir_pwd='./download/lanzou') pass
def example3(): print('download') download('https://wws.lanzous.com/izZmlfjulvg', dir_pwd='./download/test') # download('https://wws.lanzous.com/b01hjn3aj', dir_pwd='./download/lanzou') # download('https://wws.lanzous.com/b01hh63kf', dir_pwd='./download/lanzou') # downer.down_dir_by_url('https://wws.lanzous.com/b01hh2zve', dir_pwd='./download/lanzou') pass
def step1(): download('https://wws.lanzous.com/b01hlgi2b', dir_pwd='./data') download('https://wws.lanzous.com/izZmlfjulvg', dir_pwd='./data') pass
from cv2 import cv2 import numpy as np import tensorflow as tf from PIL import Image from notedrive.lanzou import LanZouCloud, CodeDetail, download import notekeras.model.yolo4.core.utils as utils from notekeras.backend import plot_model from notekeras.model.yolo4.core.yolov4 import YOLO, decode from notekeras.model.yolo4.core.yolov4 import filter_boxes data_root = '/root/workspace/notechats/notekeras/example/yolo/' # yolov4.weights download('https://wws.lanzous.com/b01hjn3yd', dir_pwd=data_root + '/models/') # yolov4-416.h5 #download('https://wws.lanzous.com/b01hl9lej', dir_pwd=data_root + '/models/') classes = utils.read_class_names(data_root + "/data/classes/coco.names") def save_tf(weights=data_root + '/models/yolov4.weights', output_h5=data_root + '/models/yolov4-416.h5', input_size=416, score_thres=0.2, framework='tf', model_name='yolov4'): STRIDES, ANCHORS, NUM_CLASS, XYSCALE = utils.load_config(model=model_name) input_layer = tf.keras.layers.Input([input_size, input_size, 3])
import time import cv2 import numpy as np from PIL import Image from notedrive.lanzou import download from notekeras.model.yolo3 import YoloBody from notekeras.utils import read_lines, draw_bbox root = '/root/workspace/notechats/notekeras/example/yolo' classes = read_lines(root + "/data/classes/coco.names") download('https://wws.lanzous.com/b01hjn3aj', dir_pwd=root + '/models/') def get_anchors(): anchors = "10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326" # anchors = '1.25,1.625, 2.0,3.75, 4.125,2.875, 1.875,3.8125, 3.875,2.8125, 3.6875,7.4375, 3.625,2.8125, 4.875,6.1875, 11.65625,10.1875' anchors = [float(x) for x in anchors.split(',')] return np.array(anchors).reshape(-1, 2) anchors = get_anchors() yolo_body = YoloBody(anchors=anchors, num_classes=len(classes)) yolo_body.load_weights(root + "/models/yolov3.h5", freeze_body=3) # yolo_body.load_layer_weights() def image_demo(image_path, output):