fix(h5): relax capture angles and annotate acne marks
This commit is contained in:
@@ -63,6 +63,15 @@ assert(smooth.text.includes('未完整获取'));
|
||||
const source = fs.readFileSync(path.join(__dirname, '../js/app.js'), 'utf8');
|
||||
const pure = source.match(/\/\* viz-pure-begin[\s\S]*?\*\/([\s\S]*?)\/\* viz-pure-end \*\//)[1];
|
||||
const sandbox = {}; vm.runInNewContext(pure, sandbox);
|
||||
vm.runInNewContext(source.slice(source.indexOf(' var VIZ_CAT ='),source.indexOf(' /* viz-pure-begin')),sandbox);
|
||||
const acneDefs=sandbox.VIZ_CAT.acne.marks;
|
||||
assert.equal(acneDefs.find(x=>x.key==='acne_mark').color,'#8750C8');
|
||||
const acneRaw={acne_mark:{count:1,rectangle:[{left:10,top:20,width:30,height:40}],polygon:[[{x:10,y:20},{x:40,y:20},{x:20,y:60}]]}};
|
||||
const acneBefore=JSON.stringify(acneRaw),acneMarks=sandbox.vizCollectMarks(acneDefs,acneRaw);
|
||||
assert.equal(acneMarks.length,1);assert.equal(acneMarks[0].rects.length,1);assert.equal(acneMarks[0].polygons.length,1);
|
||||
assert.equal(JSON.stringify(acneRaw),acneBefore,'overlay does not change detection or scoring data');
|
||||
assert.equal(sandbox.vizCollectMarks(acneDefs,{acne_mark:{count:3}}).length,0,'counts alone never generate fake positions');
|
||||
assert.equal(sandbox.vizCollectMarks(acneDefs,{acne_mark:{count:0,rectangle:[],polygon:[]}}).length,0);
|
||||
const crop = sandbox.vizFaceCrop(4000, 3000, { left: 1479, top: 1133, width: 1116, height: 1116 });
|
||||
assert(crop.focused);
|
||||
assert(crop.width < 1600 && crop.height < 1800);
|
||||
|
||||
Reference in New Issue
Block a user