Skip to content

Commit d11d1a3

Browse files
authored
added label and confidence as output for yolo results (#316)
* added label and confidence as output * updates yolo test to use label instead of className
1 parent 515ac38 commit d11d1a3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/YOLO/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class YOLOBase extends Video {
127127
w = Math.min(imageSize, w) - x;
128128

129129
const resultObj = {
130-
className,
131-
classProb,
130+
label: className,
131+
confidence: classProb,
132132
x: x / imageSize,
133133
y: y / imageSize,
134134
w: w / imageSize,

src/YOLO/index_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ describe('YOLO', () => {
3838
it('detects a robin', async () => {
3939
const robin = await getRobin();
4040
const detection = await yolo.detect(robin);
41-
expect(detection[0].className).toBe('bird');
41+
expect(detection[0].label).toBe('bird');
4242
});
4343
});

0 commit comments

Comments
 (0)