mirror of
https://gitee.com/nanjing-yimao-information/ieemoo-ai-gift.git
synced 2025-08-20 06:10:26 +00:00
update
This commit is contained in:
@ -7,6 +7,7 @@ import cv2
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
|
||||
from ultralytics.data import build_dataloader, build_yolo_dataset, converter
|
||||
from ultralytics.engine.validator import BaseValidator
|
||||
from ultralytics.utils import LOGGER, ops
|
||||
@ -145,7 +146,15 @@ class DetectionValidator(BaseValidator):
|
||||
# Predictions
|
||||
if self.args.single_cls:
|
||||
pred[:, 5] = 0
|
||||
|
||||
# =======Targets 2 分类======
|
||||
column = pred[:,5]
|
||||
condition2 = (column != 10)
|
||||
pred[:,5][condition2] = 0
|
||||
# ===========================
|
||||
|
||||
predn = self._prepare_pred(pred, pbatch)
|
||||
|
||||
stat["conf"] = predn[:, 4]
|
||||
stat["pred_cls"] = predn[:, 5]
|
||||
|
||||
|
Reference in New Issue
Block a user