原创 tornado部署

import logging from concurrent.futures import ThreadPoolExecutor from tornado.concurrent import run_on_executor import

原创 transformer代碼

import torch import numpy as np #定義輸入數據 x = [ [1, 0, 1, 0], # Input 1 [0, 2, 0, 2], # Input 2 [1, 1, 1, 1] # I

原创 NLP文本的表示

一、計算兩字符串的編輯距離 二、wordtovec的方法

原创 matplotlib條形圖

import matplotlib.pyplot as plt import matplotlib with open(r'C:\Users\Administrator\Desktop\newTest\we\zj.txt') as f:

原创 labelme轉換

import os import json path = r'D:\traindatasets\0911-wen -' # path是你存放json的路徑 json_file = os.listdir(path) for file i

原创 推薦一個很好的機器學習網站

https://www.biaodianfu.com/lightgbm.html

原创 bbox鏡像數據增強

def random_flip(img): img = img[:, ::-1, :] return img def flip_bbox(bbox, size): H, W = size bbox =

原创 數據增強2

import os import cv2 import numpy as np import math save_path = r'D:\pig2' count = 27936 def translation(image,direc

原创 PIL畫點、描框

import json import os from PIL import Image from PIL import ImageDraw basedir = r'C:\Users\Administrator\Desktop\keyp

原创 數據增強3

# # fw = open('trainyolov3_pigs.txt','w') # # with open('trainyolov3_pigs.txt') as f: # # datas = f.readlines() #

原创 圖片的旋轉增強

import cv2 import json import os from math import * def rota(img,degree,W,H,x1,y1,x2,y2): if degree == 90:

原创 Lookahead優化器

from collections import defaultdict from itertools import chain from torch.optim import Optimizer import torch import

原创 解決torch無法求導的問題

torch.autograd.Variable(img)

原创 opencv最小外接矩形

import cv2 import numpy as np img1 = cv2.imread(r'D:\test\pigs\20200518132334816.jpg.jpg',0) _,thresh = cv2.threshold(

原创 GNN庫

https://baijiahao.baidu.com/s?id=1633311544434564762&wfr=spider&for=pc