自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(72)
  • 资源 (6)
  • 收藏
  • 关注

原创 模型特征蒸馏:Contrastive Learning Rivals Masked Image Modeling in Fine-tuning via Feature Distillation

模型特征蒸馏

2023-02-22 11:35:16 259

原创 余弦学习率实现

else:

2023-02-17 21:06:51 632

原创 VIT pytorch 实现Imagenet

import torchfrom einops import rearrange, repeatfrom torch import nnimport torch.nn.functional as FMIN_NUM_PATCHES = 16class FeedForward(nn.Module): def __init__(self, dim, hidden_dim, dropout=0.): super().__init__() self.net =.

2023-02-17 21:04:16 691

原创 PIL Image resize methods

NEAREST从输入图像中选择一个最近的像素。忽略所有其他输入像素。BILINEAR (推荐)若要调整大小,请对所有可能影响输出值的像素使用线性插值计算输出像素值。对于其他变换,使用输入图像中2x2环境上的线性插值。BICUBIC若要调整大小,请对所有可能影响输出值的像素使用三次插值计算输出像素值。对于其他变换,在输入图像中使用4x4环境上的三次插值。...

2021-07-16 09:43:32 187

原创 shapely 多边形缩放

from shapely.geometry import Polygon, Point, LinearRingimport cv2import numpy as npxx = [(10, 10), (12,100), (100, 100), (20,20), (20,10)]poly = Polygon(xx)a = poly.buffer(-31)print(len(list(a.exterior.coords)))img = np.zeros((200,200,3), dtype=np..

2020-09-02 10:18:33 1246

原创 pytorch model flops and parameters count

1. flops caculate:import redef get_num_gen(gen): return sum(1 for x in gen)def flops_layer(layer): """ Calculate the number of flops for given a string information of laye...

2019-03-06 16:29:00 788

原创 keras GPU 配置灵活使用

1、指定GPUimport osos.environ["CUDA_VISIBLE_DEVICES"] = "2"2、按需分配import tensorflow as tfimport keras.backend.tensorflow_backend as KTFconfig = tf.ConfigProto() config.gpu_options.allow_growth=True #不全...

2018-06-08 08:44:05 2138 1

原创 python 多模式匹配自动机

# 结点类class node: def __init__(self, ch): self.ch = ch # 结点值 self.fail = None # Fail指针 self.tail = 0 # 尾标志:标志为 i 表示第 i 个模式串串尾 self.child = [] # 子结点 self...

2018-05-29 15:50:44 1209

原创 keras循环多输入模型的处理

def create_model(): def sum_add(x): x = K.sum(x, axis=1, keepdims=False) return x #############model1######################################################### input_1 = Inp...

2018-05-24 08:46:42 1920

原创 python基于dlib的人脸定位与人脸比对实现

import dlibcurrent_path = os.getcwd() # 获取当前路径# 模型路径predictor_path = current_path + "\\model\\shape_predictor_68_face_landmarks.dat"face_rec_model_path = current_path + "\\model\\dlib_face_recognitio...

2018-05-05 09:39:35 5467

原创 python mutiprocessing使用

帮助文档:点击打开链接mutiprocessing.Process=单进程,多进程 mutiprocessing.Lock=进程锁 mutiprocessing.Semaphore=N锁 Pool.apply_async=得到返回结果 Pool.map=批量进程import multiprocessingimport cv2def f(x): return x*2 # img ...

2018-05-04 11:24:24 419

原创 keras attention code

#lstm+attentioninputs = Input(shape=(TIME_STEPS, INPUT_DIM,))lstm_units = 32lstm_out = LSTM(lstm_units, return_sequences=True)(inputs)a = Permute((2, 1))(lstm_out)a = Reshape((input_dim, TIME_ST...

2018-04-17 09:33:09 1298 1

原创 python使用cv2进行face detect

import cv2import sys# Get user supplied valuesimagePath = 'data/0.jpg' #sys.argv[1]cascPath = 'haarcascades/haarcascade_frontalcatface.xml' #sys.argv[2]cascPath = 'haarcascades/haarcascade_front...

2018-03-22 10:38:24 1543

原创 VGG 识别结果关注区域分析代码

#coding=utf-8#keras=2.0.2#tensorflow=1.1.0from keras.applications.vgg16 import VGG16, preprocess_input, decode_predictionsfrom keras.preprocessing import imageimport keras.backend as Kimport nu

2018-03-16 09:05:21 625

原创 use sklean.model_select.GridSearchCV to find keras best parameters

#coding=utf-8import numpy as npimport kerasfrom keras.wrappers.scikit_learn import KerasClassifierfrom keras.activations import *from keras.models import *from keras.layers import *from keras.

2018-02-04 15:53:38 374

原创 vc+FTP vc+SQLServer

vc+FTP:1.stdafx.h添加//FTP#include void DisplayMsg(LPCTSTR xi_cszFormat, ...);2.dlg.h添加//FTPCInternetSession  *m_pInetSession;CFtpConnection *m_pFtpConnection;3.连接// 连接 ftpCString

2018-01-30 10:52:26 215 1

转载 PyAutoGUI自动控制鼠标和键盘操作

https://muxuezi.github.io/posts/doc-pyautogui.html

2018-01-17 10:03:40 666

原创 python实现viterbi算法

states = ('Healthy', 'Fever')observations = ('normal', 'cold', 'dizzy')start_probability = {'Healthy': 0.6, 'Fever': 0.4}transition_probability = { 'Healthy': {'Healthy': 0.7, 'Fever': 0.3},

2018-01-10 15:17:22 985

原创 python正则re使用

1、import re# 将正则表达式编译成Pattern对象pattern = re.compile(r'hello',re.I)# 使用Pattern匹配文本,获得匹配结果,无法匹配时将返回Nonematch = pattern.match('hello world!')if match:# 使用Match获得分组信息print match.group(

2018-01-05 08:11:16 602

原创 keras实现aspect level中文文本情感分类-源自EMNLP2016

原论文:http://link.zhihu.com/?target=https%3A//arxiv.org/pdf/1605.08900v2.pdf代码实现:#coding=utf-8import csv,codecsimport jieba# jieba.load_userdict('wordDict.txt')import pandas as pdfrom keras.pr

2018-01-02 08:36:09 2018 10

原创 python 朴素贝叶斯简单实现

import reimport maths=['this is yes','this is no']r=[0,1]def tokenize(message): message=message.lower() all_words = re.findall('[a-z0-9]+', message) print(all_words) return set(a

2017-12-25 17:47:03 323

原创 keras模型可视化,层可视化及kernel可视化

keras模型可视化:model:model = Sequential()# input: 100x100 images with 3 channels -> (100, 100, 3) tensors.# this applies 32 convolution filters of size 3x3 each.model.add(ZeroPadding2D((1,1), inp

2017-12-02 18:39:38 13089 10

原创 keras实现Unet进行字符定位与识别分类

#coding=utf-8import cv2import numpy as npfrom keras.utils import to_categoricalfrom model.augmentations import randomHueSaturationValue, randomShiftScaleRotate, randomHorizontalFlipfrom keras.ca

2017-11-09 09:46:34 2923 1

原创 keras实现BiLSTM+CNN+CRF文字标记NER

import kerasfrom sklearn.model_selection import train_test_splitimport tensorflow as tffrom keras.callbacks import ModelCheckpoint,Callback# import keras.backend as Kfrom keras.layers import *fr

2017-11-09 09:41:17 15451 7

原创 利用keras框架cnn+ctc_loss识别不定长字符图片

# -*- coding: utf-8 -*-#keras==2.0.5#tensorflow==1.1.0import os,sys,stringimport sysimport loggingimport multiprocessingimport timeimport jsonimport cv2import numpy as npfrom sklearn.model

2017-10-18 22:35:20 15879 23

原创 acrobat javascript

1.展开/折叠PDF书签在acrobat 添加批处理序列,javascript脚本:function collapsBM1(bm,nLevel){    if (bm.children!=null)    {        bm.style=1;        bm.open =false;        for (var i=0; i        { 

2017-09-26 17:28:13 2400

原创 py-faster-rcnn配置CPU下运行demo.py

1.git数据git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git2.下载model文件,bash ./data/scripts/fetch_faster_rcnn_models.sh下载并解压:py-faster-rcnn/data/faster_rcnn_models/VGG16_f

2017-08-25 16:32:44 2901

原创 caffe-windows cpu下编译python接口/matlab接口

1.下载caffe-windwos:https://github.com/BVLC/caffe/tree/windows2.修改scripts/build_win.cmd:64行以后::: Change the settings here to match your setup    :: Change MSVC_VERSION to 12 to use VS 2013    if

2017-07-20 09:51:17 360

原创 CRNN add digits

# for reproducibilitynp.random.seed(2016)K.set_image_dim_ordering('tf')# define some run parametersbatch_size = 32nb_epochs = 100examplesPer = 60000maxToAdd = 8hidden_units = 200size = 28# c

2017-07-18 09:43:59 826 1

原创 fld to xml and xml to fld

#coding=utf-8#将fld框文件生成xml'''VOC20122007_000027.jpgThe VOC2007 DatabasePASCAL VOC2007flickr48650030personUnspecified00174101349351'''i

2017-06-27 13:49:53 362

原创 Keras 训练时不用将数据全部加入内存

How can I use Keras with datasets that don't fit in memory?You can do batch training using model.train_on_batch(X, y) and model.test_on_batch(X, y). See the models documentation.Alternativ

2017-05-11 09:45:12 10647

原创 win7 远程配置ubuntu14 python keras tensorflow 深度学习

1.远程工具XShell5(远程命令行)+XFTP5(文件传输)2.命令行安装python3.5sudo add-apt-repository ppa:fkrull/deadsnakes  sudo apt-get update  sudo apt-get install python3.5

2017-05-10 16:41:22 380

原创 利用kmeans聚类进行颜色量化压缩图像

#coding=utf-8#########################################压缩from skimage import iofrom sklearn.cluster import KMeansimport numpy as npimage = io.imread('test.png')rows = image.shape[0]cols = im

2017-04-25 13:59:17 3892 2

原创 (superpixel)超像素分割

https://github.com/cxf2015/slic-python-implementation/commit/59b98988027dfa384310a0f7bf203ce0fa81fd10

2017-04-17 14:56:22 2465 2

原创 numpy 傅里叶变换与反变换高低通滤波与带通滤波

#coding=utf-8import cv2import numpy as npimport matplotlib.pyplot as pltimg=cv2.imread('test1-angle.jpg',cv2.IMREAD_GRAYSCALE)# f = np.fft.fft2(img)# fshift = np.fft.fftshift(f)# #取绝对值:将复数变化成

2017-04-17 14:53:06 7503

原创 使用keras预训练VGG16模型参数分类图像并提取特征

#coding=utf-8#keras==0.3.0 theano==0.8.0 python==2.7.13from keras.models import Sequentialfrom keras.layers.core import Flatten, Dense, Dropoutfrom keras.layers.convolutional import Convolution2D,

2017-04-16 16:51:38 19190 9

原创 机器学习 SVM sklearn

SVM回归代码:import numpy as npfrom sklearn import svmimport matplotlib.pyplot as pltN = 50np.random.seed(0)x = np.sort(np.random.uniform(0, 6, N), axis=0)y = 2*np.sin(x) + 0.1*np.random

2017-04-16 10:36:13 935

原创 机器学习 1.回归

线性回归:1.目标函数增加L2正则θ存在解析式:使用梯度下降进行解θ:=>代码:import numpy as npdef regression(data, alpha, lamda): n=len(data[0])-1 theta=np.zeros(n) for i in range(30): for d in data:

2017-04-14 10:58:16 573

原创 python opencv cv2 基础操作4 Extracting Features

#coding=utf-8import cv2 #cv2.__version__==3.2.0import numpy as np#Extracting Features#Detecting the corners# img=cv2.imread('corner.bmp',cv2.IMREAD_ANYCOLOR)# gray = cv2.cvtColor(img,cv2.COL

2017-04-13 13:09:32 2145

原创 python opencv cv2 基础操作3 CascadeClassifier

#coding=utf-8import cv2 #cv2.__version__==3.2.0import numpy as np#Detect face# face_cascade =cv2.CascadeClassifier('./data/haarcascades/haarcascade_frontalface_alt.xml')# scaling_factor = 1#

2017-04-13 10:54:35 8616

Python数据分析基础教程:NumPy学习指南(第2版)

免费电子书:Python数据分析基础教程:NumPy学习指南(第2版)

2017-02-09

定位图像上的直线-软件

通过图像分析,定位图像上的水平与垂直线,速度快,定位准

2013-02-07

基于office文字识别功能开发的屏幕识别软件

基于office文字识别功能开发的屏幕识别软件,识别各种语言,画框区域识别

2011-09-30

切图软件,图像处理软件

包括了图像操作(包括指定位置切图等等)的一系列功能,

2011-09-26

learningOpenCV

learningOpenCV english edition

2010-03-23

对图像中的表格单元格定位

对包含表格的图像文档中的单元格定位,VC++程序实现.

2009-03-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除