Python3 Standard Library: Managing concurrent operations in threading processes
1. Manage concurrent operations in threading processes
The threading module provides an API to manage the execution of multiple threads, allowing programs to run multiple operations concurrently in the same process space.
1.1 Thread object
The easiest way to use Thread is to instantiate a Thread object with a target function and call start() to ...
Posted by j.smith1981 on Sun, 29 Mar 2020 18:54:15 -0700
Python learning - shopping cart program
Procedure: shopping cart procedure
Demand:
After starting the program, let the user enter the salary, and then print the list of products
Allow users to purchase products according to the product number
After the user selects the goods, check whether the balance is enough, deduct the money directly if it is enough, and remind if it is not enou ...
Posted by timbuckthree on Sun, 29 Mar 2020 08:45:56 -0700
Basic technology of machine vision implemented by python+opencv (edge extraction, image filtering, edge detection operator, projection, license plate character segmentation)
Catalog
1: Edge extraction
1. Threshold segmentation and color reversal of image
2. Edge extraction
2: Image filtering
1. Read the original drawing
2. Mean filtering
3. Median filtering
4. Gaussian filtering
5. Gaussian edge detection
3: Edge detection operator
1. Display the original drawing
2. Reverse the image
3. Image edge detec ...
Posted by kliopa10 on Sun, 29 Mar 2020 05:47:54 -0700
OpenCV-Python uses OCR handwriting data set to run SVM | fifty-six
target
In this chapter, we will recognize the handwritten dataset again, but use SVM instead of kNN.
Recognize handwritten numbers
In kNN, we directly use pixel intensity as feature vector. This time we will use the directional gradient histogram (HOG) as the feature vector.
Here, we use the second-order moment to correct the skew of the image ...
Posted by gurjit on Sun, 29 Mar 2020 00:05:02 -0700
Simple mahjong ai algorithm
Simple mahjong ai algorithm
Write a mahjong game, need to automatically play ai algorithm, do it yourself, although not very smart, but surprised by its simplicity, just record it. Implemented in python.
First, summarize the rules of mahjong. The seemingly complex rules of mahjong can be expressed by a formula. Hu = AA and (AAA or AAAA or ABC) ...
Posted by daneilair on Sat, 28 Mar 2020 10:11:27 -0700
How to use python crawler to crawl from a chapter novel to a whole station novel
Preface
The text and pictures of the article are from the Internet, only for learning and communication, and do not have any commercial use. The copyright belongs to the original author. If you have any questions, please contact us in time for handling.
PS: if you need Python learning materials, you can click the link below to get http://t. ...
Posted by rinventive on Sat, 28 Mar 2020 08:08:42 -0700
Python 3 standard library: zlib GNUzlib compression
1. zlib GNUzlib compression
Zlib module provides the underlying interface for many functions in the zlib compression library of GNU Project.
1.1 processing data in memory
The simplest way to use zlib requires that all data to be compressed or decompressed be stored in memory.
import zlib
import binascii
original_data = b'This is the original ...
Posted by zippers24 on Fri, 27 Mar 2020 10:20:54 -0700
sublime shortcut keys and settings configuration - jetbrains habits
start
After many small partners use jetbrains series editors and use lightweight sublime, some settings and shortcut habits may not be suitable
Today, Xiaobian will give you some common sublime settings and shortcut key configurations
Set up
{
// Color theme
"color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme", ...
Posted by hunna03 on Fri, 27 Mar 2020 09:17:59 -0700
PyTorch distributed training course
Thank you for your reference- http://bjbsair.com/2020-03-27/tech-info/7154/
The simplest way to accelerate the training of neural network is to use GPU. The speed of GPU in the normal operation (matrix multiplication and addition) of neural network is twice faster than that of CPU. As models or datasets grow larger, a GPU will soon become inad ...
Posted by toms on Fri, 27 Mar 2020 03:51:32 -0700
Machine learning Chapter 4 training model
Reference: author's Jupyter NotebookChapter 2 – End-to-end Machine Learning project
Generate picture and savefrom __future__ import division, print_function, unicode_literals
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
np.random.seed(42)
mpl.rc('axes', labelsize=14)
mpl.rc('xtick', labelsize=12)
mpl.r ...
Posted by Scriptor on Fri, 27 Mar 2020 03:26:21 -0700