资源简介
以人群计数为例,对训练好的MCNN caffe模型,调用caffe的python接口进行前向测试,输出人群密度图。详细请参考博客:https://blog.csdn.net/u011285477/article/details/51954989
代码片段和文件信息
# -*- coding: utf-8 -*-
“““
Created on Tue Mar 28 19:53:57 2017
@author: lzhr
“““
# crowd counting with trained model
import init_path
import caffe
import tools
import os.path as osp
import numpy as np
from caffe import layers as L params as P to_proto
import matplotlib.pyplot as plt
from PIL import Image
import global_var as GV
import matplotlib.image as mpimg
import sys
import h5py
import scipy.io as sio
import os
import gc
import time
import math
import cv2
#import model
model_dir = ‘/home/lzhr/MCNN_model/‘
prototxt = os.path.join(model_dir‘BRT_testdemo.prototxt‘)
#***********************************
caffemodel = os.path.join(model_dir‘BRT_iter_48000.caffemodel.h5‘)
useroi = 0
#caffe.set_mode_cpu()
#set up the net
caffe.set_mode_gpu()
caffe.set_device(0)
net = caffe.Net(prototxt caffemodel caffe.TEST)
#-------------------------test station crowd counting---------
相关资源
- Python-BDD100K大规模多样化驾驶视频数据
- Instant Pygame for Python Game Development How
- Biopython Tutorial
- Think Python 2nd
- 一个小小的表白程序(python)
- Python课堂笔记(高淇400集第一季)
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
评论
共有 条评论