QA Official

pytorch (1) precautions for BN layer in pytorch

https://qaofficial.com/post/2019/04/24/68636-pytorch-1-precautions-for-bn-layer-in-pytorch.html 2019-04-24
When modifying a code recently, when using the network for reasoning, it was found that changing the batch size size of the test set each time would result in different reasoning results and even erroneous results. Later, it was found that BN layer was defined in the network. BN layer would transform the data in a Batch into positive distribution during the training process. During the reasoning process, the data were processed using the parameters in the training process.

selenium+chromedriver's Reverse Climbing Solution

https://qaofficial.com/post/2019/04/24/68610-selenium-chromedriveramp#x27s-reverse-climbing-solution.html 2019-04-24
Problem Background: This problem is encountered in climbing a shopping mall on a certain evening. The original plan was to use Selenium+Chrome Driver+Mitm Proxy for happy brushing. However, after a few days, it was found that the brushing could not come out, and it would jump directly to the login interface (obviously, it was encountered with reverse climbing) To tell the truth, this is the first time that selenium has been used to climb backwards, so large-scale tests and comparisons have been made.

sorting algorithm

https://qaofficial.com/post/2019/04/24/68597-sorting-algorithm.html 2019-04-24
Bubble Selection Insert Hill Fast Merge Heap SortReference ----------------------------------------------------Summary of Eight Sorting Algorithms http://blog.csdn.net/yexinghai/archive/2009/10/10/4649923.aspxComparison and Selection of Basic Sorting Algorithms http://blogger.org.cn/blog/more.asp?name=njucs&id=3950bubble sort-also called bubble sort http://roclinux.cn/?p=661Fast Sorting-The Most Important Sorting Algorithm http://roclinux.cn/?p=566Direct Insert Sort-Simplest Sort Algorithm http://roclinux.cn/?p=579Heap Sort-Inspiration from Tournament Sort http://roclinux.cn/?p=675Simple Selection Sort-The simplest selection sort http://roclinux.cn/?p=671

BN Layer

https://qaofficial.com/post/2019/04/22/34618-bn-layer.html 2019-04-22
For a small white, there is a long way to go from understanding Batch Normalization (hereinafter referred to as BN) to using BN correctly.Make a record here. The most searched thing about BN on the Internet is the derivation of principles and the source of relevant papers. For example: http://blog.csdn.net/Fate_fjh/article/details/53375881 https://www.jianshu.com/p/0312e04e4e83 But this does not help us in actual use, and it is not helpful to partners who need to use it quickly.

OpenCV Normalization of Image Illumination

https://qaofficial.com/post/2019/04/22/68473-opencv-normalization-of-image-illumination.html 2019-04-22
#include <cv.h> #include <highgui.h> #include <stdio.h> #include <string> using namespace std; void main() { int i; IplImage *pImageChannel[4] = {0,0,0,0}; int count = 15; char *name = new char; while(count<=17) { string FileName = "S010_001_015942"; itoa(count,name,10); FileName = FileName + name; FileName = FileName + string(".png"); IplImage *pSrcImage = cvLoadImage(FileName.c_str()); IplImage *pImage = cvCreateImage(cvGetSize(pSrcImage), pSrcImage->depth, pSrcImage->nChannels); if(pSrcImage) { for( i=0; i<pSrcImage->nChannels; i++) { pImageChannel[i] = cvCreateImage( cvGetSize(pSrcImage), pSrcImage->depth, 1); }//channel

Python File Rename Batch Processing

https://qaofficial.com/post/2019/04/22/68524-python-file-rename-batch-processing.html 2019-04-22
import pdb import shutil import os import xml.etree.ElementTree as ET # python 3.2 dir = "/home/Desktop/workpy"; def rename( files ): tree = ET.parse(dir + "/zp/" + files) root = tree.getroot() #print(root) #os.mkdir (dirname1) name = root.find('filename').text #name = name[:-4] print (name) print('\n') print (dir) print('\n') print(dir + "/zp/" + files) print('\n') print(dir + "/zp_2/" + name + ".xml") print('\n') shutil.copyfile(dir + "/zp/" + files, dir + "/zp_2/" + name +

Python Image Batch Processing (Image Filtering Processing)

https://qaofficial.com/post/2019/04/22/68508-python-image-batch-processing-image-filtering-processing.html 2019-04-22
# Su Haoran #[email protected] #2017.06.14 import arcpy,envipy envipy.Initialize(arcpy) from arcpy import env env.workspace="E:/aaa" rasters = arcpy.ListRasters("*", "JPG") for raster in rasters: inraster = raster outraster= "E:/bbb/lvbo_"+raster.strip(".jpg") arcpy.FilterWithConvolution_envi(inraster, outraster, "Sobel", 3, 0, 20, "") print("All have done")

Python cmd instruction to enter folder directory

https://qaofficial.com/post/2019/04/22/68498-python-cmd-instruction-to-enter-folder-directory.html 2019-04-22
From: http://blog.csdn.net/cvmat/article/details/53711641 以进入D盘文件夹,安装python第三方库pip为例: 第一种方法___单步进入 第一步:在cmd输入D: 第二步:输入dir #获得D盘文件目

Windows Executes python Programs Using bat Batch Processing

https://qaofficial.com/post/2019/04/22/68521-windows-executes-python-programs-using-bat-batch-processing.html 2019-04-22
Step 1: first write a simple python program print.py, the code is as follows: print "call success." 执行结果: >>> ================================ RESTART ================================ >>> call success. >>> 步骤2:使用bat批处理程序执行python程序,“callpython.bat

ajax page sends post request

https://qaofficial.com/post/2019/04/22/68529-ajax-page-sends-post-request.html 2019-04-22
ajax sends url request, then the background returns data, and the foreground processes according to the returned data ~ <script type="text/javascript" src="js/jquery-1.4.1.min.js"></script> <script type="text/javascript"> $().ready(function () { $('#Login').click(function () { $.ajax({ type: "POST", url: "login.action", data: "sysUser.loginName=" + escape($('#username').val()) + "&sysUser.password=" + escape($('#password').val()), beforeSend: function () { $("#login").css("display", "none"); }, success: function (msg) { if (msg == "success") { //parent.tb_remove(); parent.document.location.href = "mainPage.action"; //如果登录成