import os.path as osp
import numpy as np
head = """
`
"""
def writeHTML(out_path, results_dirs):
f = open(out_path, "w")
f.write(head + "\n")
f.write(
""
'| ID | '
' Input | '
' HAWP | '
' LETR | '
' HEAT (Ours) | '
' Ground-truth | '
"
"
)
wrong_s3d_annotations_list = [3261, 3271, 3276, 3296, 3342, 3387, 3398, 3466, 3496]
file_ids = ["0{}".format(x) for x in range(3250, 3500) if x not in wrong_s3d_annotations_list]
permuted_ids = np.random.permutation(file_ids)
file_ids = permuted_ids[:100]
for file_id in file_ids:
row_str = ""
row_str += "| {} | ".format(file_id)
for dir_idx, result_dir in enumerate(results_dirs):
if dir_idx == 0:
pred_filepath = osp.join(result_dir, "scene_{}_alpha.png".format(file_id))
row_str += ' | '.format(pred_filepath)
else:
pred_filepath = osp.join(result_dir, "{}.png".format(file_id))
row_str += ' | '.format(pred_filepath)
row_str += "
"
f.write(row_str + "\n")
f.write(end + "\n")
if __name__ == "__main__":
results_dirs = ["viz_density", "viz_hawp", "viz_letr", "viz_heat_th5", "viz_gt"]
writeHTML(out_path="./indoor_qual.html", results_dirs=results_dirs)