| 24 | } |
| 25 | |
| 26 | YoloBody_tinyImpl::YoloBody_tinyImpl(int num_anchors, int num_classes) { |
| 27 | backbone = CSPdarknet53_tiny(); |
| 28 | conv_for_P5 = BasicConv(512, 256, 1); |
| 29 | yolo_headP5 = yolo_head({ 512, num_anchors * (5 + num_classes) }, 256); |
| 30 | upsample = Upsample(256, 128); |
| 31 | yolo_headP4 = yolo_head({ 256, num_anchors * (5 + num_classes) }, 384); |
| 32 | |
| 33 | register_module("backbone", backbone); |
| 34 | register_module("conv_for_P5", conv_for_P5); |
| 35 | register_module("yolo_headP5", yolo_headP5); |
| 36 | register_module("upsample", upsample); |
| 37 | register_module("yolo_headP4", yolo_headP4); |
| 38 | } |
| 39 | std::vector<torch::Tensor> YoloBody_tinyImpl::forward(torch::Tensor x) { |
| 40 | //return feat1 with shape of {26,26,256} and feat2 of {13, 13, 512} |
| 41 | auto backbone_out = backbone->forward(x); |
nothing calls this directly
no test coverage detected