标注一下,这是一个可以启动的版本
This commit is contained in:
@ -35,9 +35,9 @@ except (ImportError, AssertionError):
|
||||
|
||||
from ultralytics.utils.plotting import Annotator, colors, save_one_box
|
||||
|
||||
from app.util.yolov5.utils import TryExcept
|
||||
from app.util.yolov5.utils.dataloaders import exif_transpose, letterbox
|
||||
from app.util.yolov5.utils.general import (
|
||||
from utils.yolov5.utils import TryExcept
|
||||
from utils.yolov5.utils.dataloaders import exif_transpose, letterbox
|
||||
from utils.yolov5.utils.general import (
|
||||
LOGGER,
|
||||
ROOT,
|
||||
Profile,
|
||||
@ -54,7 +54,7 @@ from app.util.yolov5.utils.general import (
|
||||
xyxy2xywh,
|
||||
yaml_load,
|
||||
)
|
||||
from app.util.yolov5.utils.torch_utils import copy_attr, smart_inference_mode
|
||||
from utils.yolov5.utils.torch_utils import copy_attr, smart_inference_mode
|
||||
|
||||
|
||||
def autopad(k, p=None, d=1):
|
||||
@ -473,7 +473,7 @@ class DetectMultiBackend(nn.Module):
|
||||
# TensorFlow Lite: *.tflite
|
||||
# TensorFlow Edge TPU: *_edgetpu.tflite
|
||||
# PaddlePaddle: *_paddle_model
|
||||
from app.util.yolov5.models.experimental import attempt_download, attempt_load # scoped to avoid circular import
|
||||
from utils.yolov5.models.experimental import attempt_download, attempt_load # scoped to avoid circular import
|
||||
|
||||
super().__init__()
|
||||
w = str(weights[0] if isinstance(weights, list) else weights)
|
||||
@ -661,7 +661,7 @@ class DetectMultiBackend(nn.Module):
|
||||
elif triton: # NVIDIA Triton Inference Server
|
||||
LOGGER.info(f"Using {w} as Triton Inference Server...")
|
||||
check_requirements("tritonclient[all]")
|
||||
from app.util.yolov5.utils.triton import TritonRemoteModel
|
||||
from utils.yolov5.utils.triton import TritonRemoteModel
|
||||
|
||||
model = TritonRemoteModel(url=w)
|
||||
nhwc = model.runtime.startswith("tensorflow")
|
||||
@ -780,7 +780,7 @@ class DetectMultiBackend(nn.Module):
|
||||
Example: path='path/to/model.onnx' -> type=onnx
|
||||
"""
|
||||
# types = [pt, jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs, paddle]
|
||||
from app.util.yolov5.utils.downloads import is_url
|
||||
from utils.yolov5.utils.downloads import is_url
|
||||
|
||||
sf = list(export_formats().Suffix) # export suffixes
|
||||
if not is_url(p, check=False):
|
||||
|
@ -7,7 +7,7 @@ import numpy as np
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
||||
from app.util.yolov5.utils.downloads import attempt_download
|
||||
from utils.yolov5.utils.downloads import attempt_download
|
||||
|
||||
|
||||
class Sum(nn.Module):
|
||||
@ -91,7 +91,7 @@ def attempt_load(weights, device=None, inplace=True, fuse=True):
|
||||
|
||||
Example inputs: weights=[a,b,c] or a single model weights=[a] or weights=a.
|
||||
"""
|
||||
from app.util.yolov5.models.yolo import Detect, Model
|
||||
from utils.yolov5.models.yolo import Detect, Model
|
||||
|
||||
model = Ensemble()
|
||||
for w in weights if isinstance(weights, list) else [weights]:
|
||||
|
Reference in New Issue
Block a user