test.py 787 B

1234567891011121314151617181920212223242526272829303132
  1. from models.wirenet.wirepoint_dataset import WirePointDataset
  2. from models.config.config_tool import read_yaml
  3. import matplotlib.pyplot as plt
  4. # image_file = "D:/python/PycharmProjects/data"
  5. #
  6. # label_file = "D:/python/PycharmProjects/data/labels/train"
  7. # dataset_test = WireDataset(image_file)
  8. # dataset_test.show(0)
  9. # for i in dataset_test:
  10. # print(i)
  11. cfg = 'wirenet.yaml'
  12. cfg = read_yaml(cfg)
  13. print(f'cfg:{cfg}')
  14. print(cfg['model']['n_dyn_negl'])
  15. # net = WirepointPredictor()
  16. dataset = WirePointDataset(dataset_path=cfg['io']['datadir'], dataset_type='val')
  17. # dataset.show(0)
  18. # for i in range(len(dataset)):
  19. # # dataset.show(i)
  20. for i in dataset:
  21. # dataset.show(i)
  22. # print(i)
  23. print(i[1]['wires']['line_map'].shape)
  24. plt.show(dataset['wires']['line_map'])