[Fix] Fix YOLOv8 graph and a lint issue (#459)

* add missing bg frame

* fix easydeploy lint
pull/469/head
Range King 2023-01-12 16:00:46 +08:00 committed by GitHub
parent 8e39252259
commit e66991fc6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@
Ultralytics YOLOv8, developed by Ultralytics, is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection, image segmentation and image classification tasks.
<div align=center>
<img src="https://user-images.githubusercontent.com/27466624/211810400-a12a01f5-39fc-414f-85a7-8dead9f0c232.jpg"/>
<img src="https://user-images.githubusercontent.com/27466624/211974251-8de633c8-090c-47c9-ba52-4941dc9e3a48.jpg"/>
YOLOv8-P5 model structure
</div>

View File

@ -2,6 +2,7 @@ import torch
import torch.nn as nn
from torch import Tensor
class DeployC2f(nn.Module):
def __init__(self, *args, **kwargs):
@ -9,7 +10,7 @@ class DeployC2f(nn.Module):
def forward(self, x: Tensor) -> Tensor:
x_main = self.main_conv(x)
x_main = [x_main, x_main[:,self.mid_channels:,...]]
x_main = [x_main, x_main[:, self.mid_channels:, ...]]
x_main.extend(blocks(x_main[-1]) for blocks in self.blocks)
x_main.pop(1)
return self.final_conv(torch.cat(x_main, 1))