function data = loadjson(fname,varargin)
%
% data=loadjson(fname,opt)
% or
% data=loadjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% authors:Qianqian Fang (q.fang <at> neu.edu)
% created on 2011/09/09, including previous works from
%
% Nedialko Krouchev: http://www.mathworks.com/matlabcentral/fileexchange/25713
% created on 2009/11/02
% François Glineur: http://www.mathworks.com/matlabcentral/fileexchange/23393
% created on 2009/03/22
% Joel Feenstra:
% http://www.mathworks.com/matlabcentral/fileexchange/20565
% created on 2008/07/03
%
% input:
% fname: input file name; if fname contains "{}" or "[]", fname
% will be interpreted as a JSON string
% opt: (optional) a struct to store parsing options, opt can be replaced by
% a list of ('param',value) pairs - the param string is equivallent
% to a field in opt. opt can have the following
% fields (first in [.|.] is the default)
%
% SimplifyCell [1|0]: if set to 1, loadjson will call cell2mat
% for each element of the JSON data, and group
% arrays based on the cell2mat rules.
% FastArrayParser [1|0 or integer]: if set to 1, use a
% speed-optimized array parser when loading an
% array object. The fast array parser may
% collapse block arrays into a single large
% array similar to rules defined in cell2mat; 0 to
% use a legacy parser; if set to a larger-than-1
% value, this option will specify the minimum
% dimension to enable the fast array parser. For
% example, if the input is a 3D array, setting
% FastArrayParser to 1 will return a 3D array;
% setting to 2 will return a cell array of 2D
% arrays; setting to 3 will return to a 2D cell
% array of 1D vectors; setting to 4 will return a
% 3D cell array.
% UseMap [0|1]: if set to 1, loadjson uses a containers.Map to
% store map objects; otherwise use a struct object
% ShowProgress [0|1]: if set to 1, loadjson displays a progress bar.
% ParseStringArray [0|1]: if set to 0, loadjson converts "string arrays"
% (introduced in MATLAB R2016b) to char arrays; if set to 1,
% loadjson skips this conversion.
% FormatVersion [2|float]: set the JSONLab format version; since
% v2.0, JSONLab uses JData specification Draft 1
% for output format, it is incompatible with all
% previous releases; if old output is desired,
% please set FormatVersion to 1.9 or earlier.
% Encoding ['']: json file encoding. Support all encodings of
% fopen() function
% ObjectID [0|interger or list]: if set to a positive number,
% it returns the specified JSON object by index
% in a multi-JSON document; if set to a vector,
% it returns a list of specified objects.
% JDataDecode [1|0]: if set to 1, call jdatadecode to decode
% JData structures defined in the JData
% Specification.
%
% output:
% dat: a cell array, where {...} blocks are converted into cell arrays,
% and [...] are converted to arrays
%
% examples:
% dat=loadjson('{"obj":{"string":"value","array":[1,2,3]}}')
% dat=loadjson(['examples' filesep 'example1.json'])
% dat=loadjson(['examples' filesep 'example1.json'],'SimplifyCell',0)
%
% license:
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
%
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
%
opt=varargin2struct(varargin{:});
if(regexp(fname,'^\s*(?:\[.*\])|(?:\{.*\})\s*$','once'))
string=fname;
elseif(exist(fname,'file'))
try
encoding = jsonopt('Encoding','',opt);
if(isempty(encoding))
string = fileread(fname);
else
fid = fopen(fname,'r','n',encoding);
string = fread(fid,'*char')';
fclose(fid);
end
catch
try
string = urlread(['file://',fname]);
catch
string = urlread(['file://',fullfile(pwd,fname)]);
end
end
else
error_pos('input file does not exist');
end
pos = 1; inputlen = length(string); inputstr = string;
arraytokenidx=find(inputstr=='[' | inputstr==']');
arraytoken=inputstr(arraytokenidx);
% String delimiters and escape chars identified to improve speed:
esc = find(inputstr=='"' | inputstr=='\' ); % comparable to: regexp(inputstr, '["\\]');
index_esc = 1;
opt.arraytoken_=arraytoken;
opt.arraytokenidx_=arraytokenidx;
opt.simplifycell=jsonopt('SimplifyCell',1,opt);
opt.simplifycellarray=jsonopt('SimplifyCellArray',0,opt);
opt.formatversion=jsonopt('FormatVersion',2,opt);
opt.fastarrayparser=jsonopt('FastArrayParser',1,opt);
opt.parsestringarray=jsonopt('ParseStringArray',0,opt);
opt.usemap=jsonopt('UseMap',0,opt);
opt.arraydepth_=1;
if(jsonopt('ShowProgress',0,opt)==1)
opt.progressbar_=waitbar(0,'loading ...');
end
objid=jsonopt('ObjectID',0,opt);
maxobjid=max(objid);
if(maxobjid==0)
maxobjid=inf;
end
jsoncount=1;
while pos <= inputlen
[cc,pos]=next_char(inputstr, pos);
switch(cc)
case '{'
[data{jsoncount},pos,index_esc] = parse_object(inputstr, pos, esc, index_esc,opt);
case '['
[data{jsoncount},pos,index_esc] = parse_array(inputstr, pos, esc, index_esc,opt);
otherwise
pos=error_pos('Outer level structure must be an object or an array',inputstr,pos);
end
if(jsoncount>=maxobjid)
break;
end
jsoncount=jsoncount+1;
end % while
if(length(objid)>1 || min(objid)>1)
data=data(objid(objid<=length(data)));
end
jsoncount=length(data);
if(jsoncount==1 && iscell(data))
data=data{1};
end
if(jsonopt('JDataDecode',1,varargin{:})==1)
data=jdatadecode(data,'Base64',1,'Recursive',1,varargin{:});
end
if(isfield(opt,'progressbar_'))
close(opt.progressbar_);
end
end
%%-------------------------------------------------------------------------
%% helper functions
%%-------------------------------------------------------------------------
function [object, pos,index_esc] = parse_array(inputstr, pos, esc, index_esc, varargin) % JSON array is written in row-major order
pos=parse_char(inputstr, pos, '[');
object = cell(0, 1);
arraydepth=varargin{1}.arraydepth_;
pbar=-1;
if(isfield(varargin{1},'progressbar_'))
pbar=varargin{1}.progressbar_;
end
format=varargin{1}.formatversion;
[cc,pos]=next_char(inputstr,pos);
endpos=[];
if cc ~= ']'
try
if((varargin{1}.fastarrayparser)>=1 && arraydepth>=varargin{1}.fastarrayparser)
[endpos, maxlevel]=fast_match_bracket(varargin{1}.arraytoken_,varargin{1}.arraytokenidx_,pos);
if(~isempty(endpos))
arraystr=['[' inputstr(pos:endpos)];
arraystr=sscanf_prep(arraystr);
if(isempty(find(arraystr=='"', 1)))
% handle 1D array first
if(maxlevel==1)
astr=arraystr(2:en
没有合适的资源?快使用搜索试试~ 我知道了~
OpenPose识别人体骨架MATLAB源代码
共316个文件
json:252个
dll:47个
m:4个
需积分: 5 4 下载量 41 浏览量
2023-04-05
18:40:31
上传
评论 2
收藏 502.2MB ZIP 举报
温馨提示
OpenPose识别人体骨架MATLAB源代码。将压缩包直接解压,由于openpose是深度学习框架,没有matlab的接口,无法被MATLAB直接调用,需要根据使用说明文档进行操作,无需进行任何配置,直接运行MATLAB就可以使用,可以识别人体骨架点,并根据骨架点判断人物是否发生跌倒行为。
资源推荐
资源详情
资源评论
收起资源包目录
OpenPose识别人体骨架MATLAB源代码 (316个子文件)
getModels.bat 2KB
pose_iter_116000.caffemodel 146.6MB
cublasLt64_11.dll 206.36MB
cublas64_11.dll 126.46MB
opencv_world450d.dll 111.85MB
opencv_world450.dll 58.44MB
curand64_10.dll 52.94MB
libopenblas.dll 36.56MB
opencv_imgproc310.dll 24.39MB
opencv_videoio_ffmpeg450_64.dll 21.46MB
caffehdf5_D.dll 16.83MB
caffe-d.dll 14.57MB
opencv_core310.dll 10.54MB
caffe.dll 5.31MB
openpose.dll 3.56MB
python27.dll 3.25MB
opencv_imgcodecs310.dll 2.63MB
caffehdf5.dll 2.2MB
libgfortran-3.dll 1.22MB
gflagsd.dll 544KB
opencv_videoio_msmf450_64d.dll 432KB
cudart64_110.dll 422KB
libquadmath-0.dll 324KB
glogd.dll 319KB
boost_python-vc140-mt-1_61.dll 282KB
caffehdf5_hl_D.dll 224KB
cudnn64_8.dll 218KB
boost_filesystem-vc142-mt-gd-x64-1_74.dll 208KB
caffezlibd1.dll 197KB
boost_thread-vc142-mt-gd-x64-1_74.dll 174KB
gflags.dll 137KB
boost_filesystem-vc140-mt-1_61.dll 136KB
boost_filesystem-vc142-mt-x64-1_74.dll 115KB
boost_thread-vc140-mt-1_61.dll 113KB
glog.dll 112KB
opencv_videoio_msmf450_64.dll 108KB
caffehdf5_hl.dll 102KB
VCRUNTIME140.dll 86KB
libgcc_s_seh-1.dll 81KB
caffezlib1.dll 81KB
boost_thread-vc142-mt-x64-1_74.dll 71KB
boost_system-vc140-mt-gd-1_61.dll 42KB
VCRUNTIME140_1.dll 36KB
boost_chrono-vc140-mt-1_61.dll 33KB
boost_system-vc140-mt-1_61.dll 24KB
boost_date_time-vc142-mt-gd-x64-1_74.dll 15KB
boost_system-vc142-mt-gd-x64-1_74.dll 15KB
boost_system-vc142-mt-x64-1_74.dll 10KB
boost_date_time-vc142-mt-x64-1_74.dll 10KB
17012332.xml.example 825B
OpenPoseDemo.exe 92KB
pyopenpose.exp 21KB
video_000000000208_keypoints.json 874B
video_000000000026_keypoints.json 873B
video_000000000238_keypoints.json 872B
video_000000000063_keypoints.json 872B
video_000000000214_keypoints.json 872B
video_000000000050_keypoints.json 872B
video_000000000030_keypoints.json 872B
video_000000000017_keypoints.json 872B
video_000000000031_keypoints.json 872B
video_000000000058_keypoints.json 872B
video_000000000244_keypoints.json 871B
video_000000000059_keypoints.json 871B
video_000000000032_keypoints.json 871B
video_000000000009_keypoints.json 871B
video_000000000069_keypoints.json 871B
video_000000000057_keypoints.json 871B
video_000000000194_keypoints.json 870B
video_000000000220_keypoints.json 870B
video_000000000241_keypoints.json 870B
video_000000000042_keypoints.json 869B
video_000000000250_keypoints.json 869B
video_000000000049_keypoints.json 869B
video_000000000039_keypoints.json 869B
video_000000000000_keypoints.json 869B
video_000000000221_keypoints.json 869B
video_000000000151_keypoints.json 869B
video_000000000054_keypoints.json 869B
video_000000000045_keypoints.json 869B
video_000000000016_keypoints.json 869B
video_000000000025_keypoints.json 868B
video_000000000014_keypoints.json 868B
video_000000000041_keypoints.json 868B
video_000000000240_keypoints.json 868B
video_000000000065_keypoints.json 868B
video_000000000036_keypoints.json 868B
video_000000000008_keypoints.json 868B
video_000000000013_keypoints.json 868B
video_000000000001_keypoints.json 868B
video_000000000012_keypoints.json 868B
video_000000000029_keypoints.json 868B
video_000000000002_keypoints.json 868B
video_000000000051_keypoints.json 868B
video_000000000007_keypoints.json 868B
video_000000000053_keypoints.json 867B
video_000000000004_keypoints.json 867B
video_000000000043_keypoints.json 867B
video_000000000046_keypoints.json 867B
video_000000000037_keypoints.json 867B
共 316 条
- 1
- 2
- 3
- 4
资源评论
qq_36666696
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Javascript和Python的微商城项目设计源码 - MicroMall
- 基于Java的网上订餐系统设计源码 - online ordering system
- 基于Javascript的超级美眉网络资源管理应用模块设计源码
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功