darknet网络中识别本地视频

// 郝老师修改视频,在darknet中嵌入识别本地视频的程序。
#ifdef OPENCV
image ipl_to_image(IplImage* src);
#include <stdio.h>
#include "image.h"
#include <cv.h>  
#include "highgui.h"
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
  
  
void video_yolo(char *cfgfile, char *weightfile, float thresh) 
{
	network net = parse_network_cfg(cfgfile);
	if(weightfile){
		load_weights(&net, weightfile);
	}
	detection_layer l = net.layers[net.n-1];
	//detection_layer l=detection_layer layer;
        printf("the first!\n");
	cvNamedWindow("edges",1); 
	CvCapture *cap = cvCreateFileCapture("/home/yjy/aa2.mp4");
	clock_t time;

	IplImage* frame;
	set_batch_network(&net, 1);
	srand(2222222);

	int j;
    	float nms=.5;
	box *boxes = calloc(l.side*l.side*l.n, sizeof(box));
    	float **probs = calloc(l.side*l.side*l.n, sizeof(float *));
	for(j = 0; j < l
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值