随笔分类 - python
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: test_mnist_centerloss.py # @author: jory.d # @contact: dangxusheng163@163.com # @time: 2019/11/29
阅读全文
摘要:import torch import torch.nn as nn ''' An alternative implementation for PyTorch with auto-infering the x-y dimensions. paper: An intriguing failing o
阅读全文
摘要:## 系统级别环境 sudo apt-get install python3.7-dev sudo apt-get install python3-pip python3.7 -m pip install --upgrade pip # 解码加速包,不同的环境可能会build失败 # 1.1 ubu
阅读全文
摘要:#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: Jory.d @contact: 707564875@qq.com @site: @software: PyCharm @file: ncnn_basenet.py
阅读全文
摘要:import os import os.path as osp import sys import numpy as np import datetime def mkdirs_py2(path): # 递归创建文件夹路径 if osp.exists(path): return paths = pa
阅读全文
摘要:1 准备setup.py文件 #!/usr/bin/env python # encoding = utf-8 from distutils.core import setup, Extension from Cython.Build import cythonize import os, os.p
阅读全文
摘要:#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: Jory.d @contact: 707564875@qq.com @site: @software: PyCharm @file: read_realsense_
阅读全文
摘要:# pip把wheel下载到本地## https://pip.pypa.io/en/stable/cli/pip_download/ cd /home/xx/wheels python3.7 -m pip download h5py -d ./ -i https://pypi.tuna.tsingh
阅读全文
摘要:以mmdetection工程为例 1 ubuntu使用sh套py脚本来调用 train.sh #!/usr/bin/env bash CONFIG=configs/xx/cfg_1.py WORK_DIR=train_result/20220825 CKPT=train_result/2022070
阅读全文
摘要:参考 https://blog.csdn.net/luolinll1212/article/details/106061943 1 c++ 实现 2 编写pybind11的代码 #include "pybind11/pybind11.h" #include "pybind11/numpy.h" #i
阅读全文
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: model_test1.py # @author: jory.d # @contact: # @time: 2022/01/07 22:41 # @desc: 模型测试, 查看误检和漏检 """
阅读全文
摘要:import os import os.path as osp import numpy as np from mmcv import Config from mmdet.models import build_detector import math import argparse import
阅读全文
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- import numpy as np from shapely.geometry import Point, LineString from shapely.geometry.polygon import Pol
阅读全文
摘要:参考url: https://mathpretty.com/12509.html 在调试过程中, 有时候我们需要对中间变量梯度进行监控, 以确保网络的有效性, 这个时候我们需要打印出非叶节点的梯度, 为了实现这个目的, 我们可以通过两种手段进行, 分别是: retain_grad() hook re
阅读全文
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: {NAME}.py # @author: jory.d # @contact: dangxusheng163@163.com # @time: 2021/06/29 22:09 # @desc:
阅读全文
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ # @Time :2021/4/11 19:38 # @Author :jory.d # @File :m4a_to_mp3.py # @Software :PyCharm """ 不能在pycharm里run, 只能
阅读全文
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ # @Time :2021/2/21 23:14 # @Author :jory.d # @File :roc_auc.py # @Software :PyCharm # @Desc: 绘制多分类的ROC AUC曲线
阅读全文
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ ''' 自定义重写 dataset,实现类别均衡,体现为 每个batch都可以按照自己设定得比例来采样,且支持多进程和分布式 ''' from check_pkgs import * import torch.dist
阅读全文
摘要:import torch import torch.nn as nn import torch.nn.functional as F class LSR(nn.Module): def __init__(self, n_classes=10, eps=0.1): super(LSR, self)._
阅读全文
摘要:不懂原理的同学请参考: https://blog.csdn.net/qq_43337858/article/details/102738352?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPa
阅读全文