Skip to content

Commit

Permalink
add header to csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
reinhrst committed Nov 30, 2023
1 parent f7fbbb6 commit 91b02d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/infer/tfjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export async function convert(
const numberOfFrames = await getNumberOfFrames(file)
let framenr = 0;
const textEncoder = new TextEncoder()
await outputstream.write(textEncoder.encode(
`# Framenumber, Class, x, y, w, h, confidence\n`
+ `# (x, y) is the left top of the detection\n`
+ `# all coordinates are on frame where left-top = (0, 0) and right-bottom is (1, 1)\n`
))
for await (const imageData of getFrames(file, 640, 640)) {
const [boxes, scores, classes] = await infer(model, imageData)
for (let i = 0; i < scores.length; i++) {
Expand Down

0 comments on commit 91b02d3

Please sign in to comment.