Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [39]: lines[9]
- Out[39]: 't0:1721420698.512 tF:1721420932.338: fasterrcnn_resnet50_fpn/torchreid: total_fps: 15.6, track_fps: 47.67934158624061, max_id: 30\n'
- In [40]: %cpaste
- Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
- :import re
- SPLIT_RE = re.compile("[:,]? |[:,]") # evan is silly and didn't make it easy to parse
- def split_fields(line):
- fs = SPLIT_RE.split(line.strip())
- kind = fs.pop(4)
- return kind, {k: float(v) for (k, v) in zip(fs[::2], fs[1:::2])}
- ::::::::::
- :--
- In [41]:
- In [41]: split_fields(lines[9])
- Out[41]:
- ('fasterrcnn_resnet50_fpn/torchreid',
- {'t0': 1721420698.512,
- 'tF': 1721420932.338,
- 'total_fps': 15.6,
- 'track_fps': 47.67934158624061,
- 'max_id': 30.0})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement