| 234 | |
| 235 | |
| 236 | def update_vis_plot(iteration, loc, conf, window1, window2, update_type, |
| 237 | epoch_size=1): |
| 238 | viz.line( |
| 239 | X=torch.ones((1, 3)).cpu() * iteration, |
| 240 | Y=torch.Tensor([loc, conf, loc + conf]).unsqueeze(0).cpu() / epoch_size, |
| 241 | win=window1, |
| 242 | update=update_type |
| 243 | ) |
| 244 | # initialize epoch plot on first iteration |
| 245 | if iteration == 0: |
| 246 | viz.line( |
| 247 | X=torch.zeros((1, 3)).cpu(), |
| 248 | Y=torch.Tensor([loc, conf, loc + conf]).unsqueeze(0).cpu(), |
| 249 | win=window2, |
| 250 | update=True |
| 251 | ) |
| 252 | |
| 253 | |
| 254 | if __name__ == '__main__': |