QA Official

Batch Change Image Size to Unified Size  python complement

https://qaofficial.com/post/2019/04/20/68454-batch-change-image-size-to-unified-size-python-complement.html 2019-04-20
code is here: from PIL import Image import os.path import glob def convertjpg(jpgfile,outdir,width=128,height=128):  img=Image.open(jpgfile)  try:  new_img=img.resize((width,height),Image.BILINEAR)  new_img.save(os.path.join(outdir,os.path.basename(jpgfile)))  except Exception as e:  print(e) for jpgfile in glob.glob("/home/aa/qxq/project/fruits/database/fruitsVegtables/tomato/*.jpg"):  convertjpg(jpgfile,"/home/aa/qxq/project/fruits/database/fruitsVegtables/tomato")  

Book isbn Batch Generation of One-dimensional Barcodes

https://qaofficial.com/post/2019/04/20/68615-book-isbn-batch-generation-of-one-dimensional-barcodes.html 2019-04-20
Book isbn bar code is a one-dimensional bar code printed on the lower right side of the back of the book, which can be read with a scanning gun with high speed and accuracy.Most of the time, we need to generate the one-dimensional barcode in batch, input the isbn number to be converted into a column in xls, and then use this tool software to automatically generate the corresponding one-dimensional code.

Deep Residual Learning

https://qaofficial.com/post/2019/04/20/68313-deep-residual-learning.html 2019-04-20
Looking at the milestone of CNN network, the latest deep residual network ResNet Microsoft's deep residual network ResNet originated from 2016 CVPR best paper-deep residual learning for image recognition, paper: pdf This 152-layer ResNet architecture is deep. In addition to setting a record on the number of layers, the error rate of ResNet is surprisingly low, reaching 3.6%, and human beings are at a level of about 5% ~ 10%.

Design Pattern MediatorPattern

https://qaofficial.com/post/2019/04/20/25421-design-pattern-mediatorpattern.html 2019-04-20
1, different from the visitor pattern, the visitor pattern has specific data elements, and the access pattern data elements are extensible; /** * Created by tory on 2017/12/11. * //中介者模式, * 适合两人之间单独联系;不适合群聊 * 不同与访问者模式,访问者模式有

Machine Learning Experiment (IX): Anomaly Detection Based on Gaussian Distribution and OneClassSVM

https://qaofficial.com/post/2019/04/20/68355-machine-learning-experiment-ix-anomaly-detection-based-on-gaussian-distribution-and-oneclasssvm.html 2019-04-20
Statement: All rights reserved. Please contact the author and indicate the source in http://blog.csdn.net/u013719780?viewmode=contents

Multi-thread and Multi-task Download under Android and Resume Transmission at Breakpoints

https://qaofficial.com/post/2019/04/20/68396-multi-thread-and-multi-task-download-under-android-and-resume-transmission-at-breakpoints.html 2019-04-20
uses a third-party library: filedownloader reference compile 'com.liulishuo.filedownloader:library:1.6.9'使用: //下载单个文件public static void

PCA:matlab Principal Component Analysis

https://qaofficial.com/post/2019/04/20/68382-pcamatlab-principal-component-analysis.html 2019-04-20
Generally, dimensionality reduction is required for high-dimensional data. In matlab, pca is used for data analysis and principal component analysis: Principal Component Analysis. Matlab calls PCA as follows: XMean = mean(X);%X每行是一个实例,每列代表一个属性 X = bsxfun(@minu

Python——Excel Data Converted into Matrix

https://qaofficial.com/post/2019/04/20/68601-pythonexcel-data-converted-into-matrix.html 2019-04-20
def excel2m(path): data = xlrd.open_workbook(path) table = data.sheets()[0] nrows = table.nrows # 行数 ncols = table.ncols # 列数 c1 = np.arange(0, nrows, 1) datamatrix = np.zeros((nrows, ncols)) for x in range(ncols): cols = table.col_values(x) minVals = min(cols) maxVals = max(cols) cols1 = np.matrix(cols) # 把list转换为矩阵进行矩阵操作 ranges = maxVals - minVals b = cols1

Section 10-Support Vector Machine (SVM) Algorithm Code

https://qaofficial.com/post/2019/04/20/68359-section-10-support-vector-machine-svm-algorithm-code.html 2019-04-20
1 small example of svm implemented by sklearn from sklearn import svm X = [[2,0],[1,1],[2,3]] y = [0,0,1] clf = svm.SVC(kernel = "linear") clf.fit(X,y) print(clf) print(clf.support_vectors_) print(clf.support_) print(clf.n_support_) 2 Draw Decision Boundaries with sklearn import numpy as np import pylab as pl from sklearn import svm np.random.seed(0) X = np.r_[np.random.randn(20,2) - [2,2],np.random.randn(20,2) + [2,2]] Y = [0] * 20 + [1] * 20 clf = svm.SVC(kernel = "linear") clf.fit(X,Y) w = clf.

Select Sort (Pseudo Code Algorithm, c++, and python Implementation)

https://qaofficial.com/post/2019/04/20/69754-select-sort-pseudo-code-algorithm-c-and-python-implementation.html 2019-04-20
pseudocode is still written on notepad++. SelectSort (input ele[],input length) for i <- 1 to length step 1 min <- i for j <- i+1 to length step 1 if ele[j] < ele[min] min <- j end if swap(ele[j],ele[min]) end c++ version, vs2010. void selectsort(int a[],int length) { int i,j; for (i= 0;i < length;i++) { int min = i; for (j = i + 1; j < length; j++)