Comments (5)
% get default parameters pChns
if(nargin==2), pChns=varargin{1}; else pChns=[]; end
if( ~isfield(pChns,'complete') || pChns.complete~=1 || isempty(I) )
p=struct('enabled',{},'name',{},'hFunc',{},'pFunc',{},'padWith',{});
pChns = getPrmDflt(varargin,{'shrink',4,'pColor',{},'pGradMag',{},...
'pGradHist',{},'pCustom',p,'complete',1},1);
pChns.pColor = getPrmDflt( pChns.pColor, {'enabled',1,...
'smooth',1, 'colorSpace','luv'}, 1 );
pChns.pGradMag = getPrmDflt( pChns.pGradMag, {'enabled',1,...
'colorChn',0,'normRad',5,'normConst',.005,'full',0}, 1 );
pChns.pGradHist = getPrmDflt( pChns.pGradHist, {'enabled',1,...
'binSize',[],'nOrients',6,'softBin',0,'useHog',0,'clipHog',.2}, 1 );
nc=length(pChns.pCustom); pc=cell(1,nc);
for i=1:nc, pc{i} = getPrmDflt( pChns.pCustom(i), {'enabled',1,...
'name','REQ','hFunc','REQ','pFunc',{},'padWith',0}, 1 ); end
if( nc>0 ), pChns.pCustom=[pc{:}]; end
end
if(nargin==0), chns=pChns; return; end
I believe isInit
should be the C++ equivalent of the matlab condition that trigger the final line above if(nargin==0), chns=pChns; return; end
.
That's probably what should happen here:
acf/src/lib/acf/chnsCompute.cpp
Lines 182 to 183 in 17b8da4
if (!pChnsIn.complete.has || (pChnsIn.complete.get() != 1) || IIn.empty())
{
// Create default structures and merge:
{
// top level
Options::Pyramid::Chns dfs;
dfs.shrink = { "shrink", 4 };
dfs.complete = { "complete", 1 };
pChns.merge(dfs, 1);
}
// <SNIP>
//std::cout << pChns << std::endl;
// TODO
}
Ah. TODO :)
This lib was created as part of an effort to get a few trained models running on a phone, so only some subset of the functionality has been tested. I'm not too surprised there are a number of use case gaps. Thanks for reporting. If you have a fix, feel free to send it. Otherwise, I can take a look later. We can add some GTests to cover some of this behavior as the issues come up.
The tests are here:
acf/src/lib/acf/ut/test-acf.cpp
Lines 382 to 400 in 17b8da4
TEST_F(ACFTest, ACFchnsCompute_isInit)
{
// some test for expected default values with isInit here
}
from acf.
Don't have any proper fix as I'm handling the options on my own for now. There's a similar construct in chnsPyramid
though which seems to work:
https://github.com/elucideye/acf/blob/master/src/lib/acf/chnsPyramid.cpp#L179-L183
from acf.
To be true to the reference implementation I suppose we should aim for the following:
>> result = chnsCompute
result =
shrink: 4
pColor: [1x1 struct]
pGradMag: [1x1 struct]
pGradHist: [1x1 struct]
pCustom: [0x0 struct]
complete: 1
>> result.pColor
ans =
enabled: 1
smooth: 1
colorSpace: 'luv'
>> result.pGradMag
ans =
enabled: 1
colorChn: 0
normRad: 5
normConst: 0.0050
full: 0
>> result.pGradHist
ans =
enabled: 1
binSize: []
nOrients: 6
softBin: 0
useHog: 0
clipHog: 0.2000
>> result.pCustom
is empty
>> result.complete
ans =
1
from acf.
>> result = chnsPyramid
result =
pChns: [1x1 struct]
nPerOct: 8
nOctUp: 0
nApprox: 7
lambdas: []
pad: [0 0]
minDs: [16 16]
smooth: 1
concat: 1
complete: 1
w/ >> result.pChns
same as above
from acf.
This should be consistent with the Matlab toolbox code now (after PR #40). I've added a couple tests to ensure that the default parameter retrieval is working and returning expected values. Closing ...
from acf.
Related Issues (20)
- Execute issues in cross platform board HOT 13
- build issues for X86 Linux HOT 4
- acf shared library link ogles_gpgpu errors HOT 2
- Xcode 10.2 build failure
- Ubuntu 18.04 w/ gcc-5-pic-hid-sections-lto HOT 5
- Ubuntu 18.04 w/ linux-gcc-armhf-neon HOT 5
- Support OpenGL ES 2.0/3.0 on Desktop systems HOT 1
- 's|HUNTER_PROJECT_NAME|ELUCIDEYE_PROJECT_NAME|g' or similar
- Confusing installation
- convTri is not correctly called when calculating the pyramid HOT 2
- add pixel level acf pyramid tests : c++ vs matlab
- gradient hist channels are swapped HOT 6
- doxygen api docs
- https://github.com/jmbuena/toolbox.badacost.faces.public
- ACF_BUILD_OGLES_GPGPU=OFF broken HOT 1
- `GIT_SELF` package test HOT 1
- api tests vs unit tests HOT 5
- promote GPUDetectionPipeline to public API
- acf model parsing edge cases HOT 1
- ogles_gpgpu compile error HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acf.