摘要:pybind11.hpp pybind11.cpp #include "pybind11.hpp" #include <stdio.h> #include <iostream> using namespace std; namespace py = pybind11; class Animal{ p
阅读全文
11 2022 档案
摘要:Sigmoid就是1 / (1 + e**-x)。所以如果你想反转它, 你可以直接使用-ln((1 / x) - 1)。出于数值稳定性的目的 ,您还可以使用-ln((1 / (x + 1e-8)) - 1)。这是sigmoid的反函数,实现起来很简单。
阅读全文
摘要:import cv2 import numpy as np import torch.nn import torchvision import torchvision.transforms.functional as T checkpoint = torch.load("D:/yolov5m.pt"
阅读全文
摘要:连接 https://blog.csdn.net/qq_43799400/article/details/126401451 亲测有效
阅读全文
摘要:import math import torch import torch.nn as nn import yaml import nn_utils # 制造一个整除的数字 def make_divisible(x, divisor): return math.ceil(x / divisor) *
阅读全文
摘要:#include <stdio.h> #include <cuda_runtime.h> /* CUDA核函数 __global__ 核函数的前缀定义 - 使用__global__修饰的函数,必须是void无返回值 - __global__核函数修饰,必须是nvcc编译才有效,否则无效 - __gl
阅读全文
摘要:import torch import torch.nn as nn import torch.optim as optim import dataset import models import nn_utils class YoloHead(nn.Module): def __init__(se
阅读全文
摘要:cuda11.2安装时和nvidia frameview sdk冲突怎么解决呀? - 知乎 (zhihu.com) 设置-应用-卸载nvidia frameview.
阅读全文
摘要:工具网站 GitHub - lutzroeder/netron: Visualizer for neural network, deep learning, and machine learning models web在线网站 bottleneck.onnx (netron.app)
阅读全文
摘要:import os import random import sys import cv2 import numpy as np from PIL import Image import sys_utils import nn_utils from sys_utils import _single_
阅读全文
摘要:因为是pixel映射到对应的M矩阵对应位置,并且只需要前4个值(left,right,top,bottom) merge_mosaic_pixel_annotations = np.arange(0, 10).reshape(2, 5) print(f"merge_mosaic_pixel_anno
阅读全文
摘要:import json import numpy as np import torch from scipy.cluster.vq import kmeans2,kmeans from sklearn.cluster import k_means import random with open("i
阅读全文
摘要:k=2 data = np.random.randn(100,2) data[:50]+=2.0 center_index = np.random.choice(np.arange(len(data)), k) center = data[center_index] iters = 20 def d
阅读全文
摘要:按照面积排序 from scipy.cluster.vq import kmeans import numpy as np new_anchor = np.arange(0,9).reshape(3,3) print(new_anchor) print(new_anchor.prod(axis =1
阅读全文
摘要:from albumentations.core.transforms_interface import DualTransform from albumentations.pytorch import ToTensorV2, ToTensor import random View Code # 随
阅读全文
摘要:import numpy as np def draw_gauss(heatmap, x, y, gsize): height, width = heatmap.shape[:2] gsize += 1 - (gsize % 2) sigma = gsize / 6 s = 2 * sigma *
阅读全文
摘要:class GIoULoss(nn.Module): def __init__(self): super().__init__() def forward(self, A, B): num_bbox = A.size(0) * A.size(2) ax, ay, ar, ab = A[:, 0],
阅读全文
摘要:def smooth_l1_loss_modify(predict, target, mask, sigma=3): # predict: bx2x96x128 # target : bx2x96x128 # mask : bx2x96x128 num_object = mask.sum().ite
阅读全文