A Custom Data Parallel class that properly gathers lists of dictionaries.
| 628 | from queue import Queue |
| 629 | |
| 630 | class CustomDataParallel(torch.nn.DataParallel): |
| 631 | """ A Custom Data Parallel class that properly gathers lists of dictionaries. """ |
| 632 | def gather(self, outputs, output_device): |
| 633 | # Note that I don't actually want to convert everything to the output_device |
| 634 | return sum(outputs, []) |
| 635 | |
| 636 | def evalvideo(net:Yolact, path:str, out_path:str=None): |
| 637 | # If the path is a digit, parse it as a webcam index |