| 25 | |
| 26 | |
| 27 | class DetectionPipeline(Pipeline): |
| 28 | def __init__(self, batch_size, device_id, file_root, annotations_file): |
| 29 | super().__init__(batch_size, 2, device_id, True, 12) |
| 30 | |
| 31 | # Reading COCO dataset |
| 32 | self.input = ops.readers.COCO( |
| 33 | file_root=file_root, |
| 34 | annotations_file=annotations_file, |
| 35 | shard_id=device_id, |
| 36 | num_shards=1, |
| 37 | ratio=True, |
| 38 | ltrb=True, |
| 39 | ) |
| 40 | |
| 41 | def define_graph(self): |
| 42 | inputs, boxes, labels = self.input(name="Reader") |
| 43 | return inputs, boxes.gpu(), labels |
| 44 | |
| 45 | |
| 46 | def data_paths(): |
no outgoing calls