随笔分类 -  python

摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: test_mnist_centerloss.py # @author: jory.d # @contact: dangxusheng163@163.com # @time: 2019/11/29 阅读全文
posted @ 2024-11-25 22:23 dangxusheng 阅读(109) 评论(0) 推荐(0) 编辑
摘要:import torch import torch.nn as nn ''' An alternative implementation for PyTorch with auto-infering the x-y dimensions. paper: An intriguing failing o 阅读全文
posted @ 2023-02-07 22:31 dangxusheng 阅读(91) 评论(0) 推荐(0) 编辑
摘要:## 系统级别环境 sudo apt-get install python3.7-dev sudo apt-get install python3-pip python3.7 -m pip install --upgrade pip # 解码加速包,不同的环境可能会build失败 # 1.1 ubu 阅读全文
posted @ 2022-11-22 20:44 dangxusheng 阅读(1671) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: Jory.d @contact: 707564875@qq.com @site: @software: PyCharm @file: ncnn_basenet.py 阅读全文
posted @ 2022-11-11 18:34 dangxusheng 阅读(962) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-11-09 23:05 dangxusheng 阅读(20) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-11-09 22:33 dangxusheng 阅读(941) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # encoding: utf-8 """ @version: v1.0 @author: Jory.d @contact: 707564875@qq.com @site: @software: PyCharm @file: read_realsense_ 阅读全文
posted @ 2022-11-09 11:14 dangxusheng 阅读(2922) 评论(0) 推荐(0) 编辑
摘要:# 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 阅读全文
posted @ 2022-11-05 17:31 dangxusheng 阅读(825) 评论(0) 推荐(0) 编辑
摘要:以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 阅读全文
posted @ 2022-10-18 15:35 dangxusheng 阅读(74) 评论(0) 推荐(0) 编辑
摘要:参考 https://blog.csdn.net/luolinll1212/article/details/106061943 1 c++ 实现 2 编写pybind11的代码 #include "pybind11/pybind11.h" #include "pybind11/numpy.h" #i 阅读全文
posted @ 2022-10-18 15:24 dangxusheng 阅读(364) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: model_test1.py # @author: jory.d # @contact: # @time: 2022/01/07 22:41 # @desc: 模型测试, 查看误检和漏检 """ 阅读全文
posted @ 2022-10-18 15:17 dangxusheng 阅读(1460) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-10-18 15:10 dangxusheng 阅读(60) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- import numpy as np from shapely.geometry import Point, LineString from shapely.geometry.polygon import Pol 阅读全文
posted @ 2022-07-13 23:36 dangxusheng 阅读(1047) 评论(0) 推荐(0) 编辑
摘要:参考url: https://mathpretty.com/12509.html 在调试过程中, 有时候我们需要对中间变量梯度进行监控, 以确保网络的有效性, 这个时候我们需要打印出非叶节点的梯度, 为了实现这个目的, 我们可以通过两种手段进行, 分别是: retain_grad() hook re 阅读全文
posted @ 2022-04-14 20:49 dangxusheng 阅读(742) 评论(0) 推荐(1) 编辑
摘要:#!/usr/bin/env python # -*- coding:utf-8-*- # file: {NAME}.py # @author: jory.d # @contact: dangxusheng163@163.com # @time: 2021/06/29 22:09 # @desc: 阅读全文
posted @ 2022-02-13 21:33 dangxusheng 阅读(179) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ # @Time :2021/4/11 19:38 # @Author :jory.d # @File :m4a_to_mp3.py # @Software :PyCharm """ 不能在pycharm里run, 只能 阅读全文
posted @ 2021-04-11 20:04 dangxusheng 阅读(1082) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ # @Time :2021/2/21 23:14 # @Author :jory.d # @File :roc_auc.py # @Software :PyCharm # @Desc: 绘制多分类的ROC AUC曲线 阅读全文
posted @ 2021-03-10 22:47 dangxusheng 阅读(389) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python3 # _*_coding:utf-8 _*_ ''' 自定义重写 dataset,实现类别均衡,体现为 每个batch都可以按照自己设定得比例来采样,且支持多进程和分布式 ''' from check_pkgs import * import torch.dist 阅读全文
posted @ 2021-02-06 18:47 dangxusheng 阅读(2896) 评论(0) 推荐(0) 编辑
摘要: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)._ 阅读全文
posted @ 2021-02-06 18:42 dangxusheng 阅读(1725) 评论(0) 推荐(0) 编辑
摘要:不懂原理的同学请参考: https://blog.csdn.net/qq_43337858/article/details/102738352?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPa 阅读全文
posted @ 2021-02-06 17:55 dangxusheng 阅读(1352) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示