Created
March 25, 2019 05:18
-
-
Save t27/50746442a179f02d8dc345d3f0331362 to your computer and use it in GitHub Desktop.
Parse the tensorboard files generated during evaluation for the TensorFlow object detection API
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
from tensorboard.backend.event_processing import event_accumulator | |
import json | |
eval_log_file_path = "path/to/events.out.tfevents.1555555555.0.0.0.0" | |
def modelEvalPathParser(path_to_eval_log): | |
ea = event_accumulator.EventAccumulator(path_to_eval_log) | |
ea.Reload() | |
jsonresult = {} | |
csvresult = "classname,ap\n" | |
step="" | |
for tag in ea.Tags()['scalars']: | |
label = tag.replace('PASCAL/Precision/[email protected]','mAP') | |
label = label.replace('PASCAL/PerformanceByCategory/[email protected]/',"") | |
scalars = ea.Scalars(tag)[0] | |
jsonresult[label] = scalars[2] | |
step = scalars[1] | |
csvresult+=f'{label},{scalars[2]}\n' | |
return jsonresult,csvresult,step |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment