Last active
April 27, 2021 12:46
-
-
Save piercus/4e2059f04a842fc2b54043631c743c9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const folder = 'tmp/urbansoccer-tracks/' | |
const filename = folder + '1616079689177-person-7b4a5-0-92.316992.multiview-track'; | |
const obj = JSON.parse(fs.readFileSync(filename)); | |
console.log(`# Track name : ${obj.trackId} (${obj.trackCategory})`) | |
console.log(`\n## Cam 1 screen positions : (csv format)\n`) | |
console.log('frameIndex,top,left,width,height') | |
obj.checkpoints.filter(({camId}) => camId === 'cam1').forEach(({camId, frameIndex, detection}) => { | |
console.log([frameIndex].concat(detection.box).join(',')) | |
}) | |
console.log(`\n## Cam 2 screen positions : (csv format)\n`) | |
console.log('frameIndex,top,left,width,height') | |
obj.checkpoints.filter(({camId}) => camId === 'cam2').forEach(({camId, frameIndex, detection}) => { | |
console.log([frameIndex].concat(detection.box).join(',')) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment