1 Star 1 Fork 0

sean/voc-release4.01

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
writemodel.m 925 Bytes
一键复制 编辑 原始数据 按行查看 历史
Ross Girshick 提交于 2011-12-21 20:01 . initial check in of voc-release4.01
function writemodel(modfile, model)
blocks = cell(model.numblocks, 1);
% filters
for i = 1:model.numfilters
if model.filters(i).flip == 0
bl = model.filters(i).blocklabel;
blocks{bl} = model.filters(i).w(:);
end
end
% offsets
for i = 1:length(model.rules)
for j = 1:length(model.rules{i})
bl = model.rules{i}(j).offset.blocklabel;
blocks{bl} = model.rules{i}(j).offset.w;
end
end
% deformation models
for i = 1:length(model.rules)
for j = 1:length(model.rules{i})
if model.rules{i}(j).type == 'D' && model.rules{i}(j).def.flip == 0
bl = model.rules{i}(j).def.blocklabel;
blocks{bl} = model.rules{i}(j).def.w(:);
end
end
end
% concatenate
m = [];
for i = 1:model.numblocks
m = [m; blocks{i}];
end
% sanity check
if sum(model.blocksizes) ~= length(m)
error('model size error');
end
% write to modfile
fid = fopen(modfile, 'wb');
fwrite(fid, m, 'double');
fclose(fid);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/seanx02/voc-release4.01.git
git@gitee.com:seanx02/voc-release4.01.git
seanx02
voc-release4.01
voc-release4.01
master

搜索帮助