日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

matlab rootdir,Python cfg.ROOT_DIR属性代码示例

發布時間:2023/12/10 python 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 matlab rootdir,Python cfg.ROOT_DIR属性代码示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]

# 或者: from fast_rcnn.config.cfg import ROOT_DIR [as 別名]

def demo(net, image_name, classes):

"""Detect object classes in an image using pre-computed object proposals."""

# Load pre-computed Selected Search object proposals

box_file = os.path.join(cfg.ROOT_DIR, 'data', 'demo',

image_name + '_boxes.mat')

obj_proposals = sio.loadmat(box_file)['boxes']

# Load the demo image

im_file = os.path.join(cfg.ROOT_DIR, 'data', 'demo', image_name + '.jpg')

im = cv2.imread(im_file)

# Detect all object classes and regress object bounds

timer = Timer()

timer.tic()

scores, boxes = im_detect(net, im, obj_proposals, len(classes))

timer.toc()

print ('Detection took {:.3f}s for '

'{:d} object proposals').format(timer.total_time, boxes.shape[0])

# Visualize detections for each class

CONF_THRESH = 0.8

NMS_THRESH = 0.3

for cls in classes:

cls_ind = CLASSES.index(cls)

cls_boxes = boxes[:, 4*cls_ind:4*(cls_ind + 1)]

cls_scores = scores[:, cls_ind]

dets = np.hstack((cls_boxes,

cls_scores[:, np.newaxis])).astype(np.float32)

keep = nms(dets, NMS_THRESH)

dets = dets[keep, :]

print 'All {} detections with p({} | box) >= {:.1f}'.format(cls, cls,

CONF_THRESH)

vis_detections(im, cls, dets, thresh=CONF_THRESH)

總結

以上是生活随笔為你收集整理的matlab rootdir,Python cfg.ROOT_DIR属性代码示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。