下载模型:

1、https://github.com/richzhang/colorization/tree/master/colorization/resources(#加载聚类中心)

2、https://github.com/richzhang/colorization/blob/master/colorization/models/colorization_deploy_v2.prototxt(配置文件)

3、http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel(caffe模型

着色模型(colorization model)

该模型与之前的基于CNN模型的不同之处在于,它是一个无监督的学习过程,不会把着色对象与训练生成看成是一个回归问题、而且是使用CIE Lab色彩空间,使用L分量作为输入,输出为颜色分量a,b,通过对颜色分量进行量化,把网络作为一个分类问题对待, 对得到输出结果,最终加上L分量之后,得到着色之后的图像,模型架构如下:

其中卷积层每一个block是有几个重复的conv卷积操作与ReLU + BN层构成!其中蓝色部分,是a,b颜色的313对 ab量化表示。最终学习到的就是WxHx313输出,进一步转换为Color ab的输出, 加上L分量之后就是完整的图像输出!313对ab色彩空间量化表示如下:

(a)量化的ab颜色空间,网格大小为10.总共313个ab对在色域。 (b)ab值的经验概率分布,以对数标度表示。

(c)以L为条件的ab值的经验概率分布以对数标度表示。

针对自然场景下,ab值较低导致生成图像的失真问题,通过分类再平衡技术依靠训练阶段,通过对损失函数调整像素权重,实现了比较好的效果。


Lab 由三个通道组成,但不是R、G、B通道。它的一个通道是亮度,即L。另外两个是色彩通道,用A和B来表示。A通道包括的颜色是从深绿色(底亮度值)到灰色(中亮度值)再到亮粉红色(高亮度值);B通道则是从亮蓝色(底亮度值)到灰色(中亮度值)再到黄色(高亮度值)。Lab颜色空间中的L分量用于表示像素的亮度,取值范围是[0,100],表示从纯黑到纯白;a表示从红色到绿色的范围,取值范围是[127,-128];b表示从黄色到蓝色的范围,取值范围是[127,-128]。下图所示为Lab颜色空间的图示;

RGB转Lab颜色空间

RGB颜色空间不能直接转换为Lab颜色空间,需要借助XYZ颜色空间,把RGB颜色空间转换到XYZ颜色空间,之后再把XYZ颜色空间转换到Lab颜色空间。RGB与XYZ颜色空间有如下关系:

其中 X = 0.412453 * R +  0.412453 *G+ 0.412453B ;  各系数相加之和为0.950456,非常接近于1,我们知道R/G/B的取值范围为[ 0,255 ],如果系数和等于1,则X的取值范围也必然在[ 0,255 ]之间,因此我们可以考虑等比修改各系数,使其之和等于1,这样就做到了XYZ和RGB在同等范围的映射。式中,Xn = 0.950456f;    Yn = 1.0f;      Zn = 1.088754f;

                           

sample:

//  D:\Program Files\OpenCV\opencv\sources\samples\dnn// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>using namespace cv;
using namespace cv::dnn;
using namespace std;// the 313 ab cluster centers from pts_in_hull.npy (already transposed)
static float hull_pts[] = {-90., -90., -90., -90., -90., -80., -80., -80., -80., -80., -80., -80., -80., -70., -70., -70., -70., -70., -70., -70., -70.,-70., -70., -60., -60., -60., -60., -60., -60., -60., -60., -60., -60., -60., -60., -50., -50., -50., -50., -50., -50., -50., -50.,-50., -50., -50., -50., -50., -50., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -40., -30.,-30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -30., -20., -20., -20., -20., -20., -20., -20.,-20., -20., -20., -20., -20., -20., -20., -20., -20., -10., -10., -10., -10., -10., -10., -10., -10., -10., -10., -10., -10., -10.,-10., -10., -10., -10., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 10., 10., 10., 10., 10., 10., 10.,10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 10., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20., 20.,20., 20., 20., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 30., 40., 40., 40., 40.,40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 40., 50., 50., 50., 50., 50., 50., 50., 50., 50., 50.,50., 50., 50., 50., 50., 50., 50., 50., 50., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60., 60.,60., 60., 60., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 70., 80., 80., 80.,80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 80., 90., 90., 90., 90., 90., 90., 90., 90., 90., 90.,90., 90., 90., 90., 90., 90., 90., 90., 90., 100., 100., 100., 100., 100., 100., 100., 100., 100., 100., 50., 60., 70., 80., 90.,20., 30., 40., 50., 60., 70., 80., 90., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., -20., -10., 0., 10., 20., 30., 40., 50.,60., 70., 80., 90., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., -40., -30., -20., -10., 0., 10., 20.,30., 40., 50., 60., 70., 80., 90., 100., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., -50.,-40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100., -60., -50., -40., -30., -20., -10., 0., 10., 20.,30., 40., 50., 60., 70., 80., 90., 100., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90.,100., -80., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., -80., -70., -60., -50.,-40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., 90., -90., -80., -70., -60., -50., -40., -30., -20., -10.,0., 10., 20., 30., 40., 50., 60., 70., 80., 90., -100., -90., -80., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30.,40., 50., 60., 70., 80., 90., -100., -90., -80., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70.,80., -110., -100., -90., -80., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., -110., -100.,-90., -80., -70., -60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., 80., -110., -100., -90., -80., -70.,-60., -50., -40., -30., -20., -10., 0., 10., 20., 30., 40., 50., 60., 70., -110., -100., -90., -80., -70., -60., -50., -40., -30.,-20., -10., 0., 10., 20., 30., 40., 50., 60., 70., -90., -80., -70., -60., -50., -40., -30., -20., -10., 0.
};int main(int argc, char **argv)
{const string about ="This sample demonstrates recoloring grayscale images with dnn.\n""This program is based on:\n""  http://richzhang.github.io/colorization\n""  https://github.com/richzhang/colorization\n""Download caffemodel and prototxt files:\n""  http://eecs.berkeley.edu/~rich.zhang/projects/2016_colorization/files/demo_v2/colorization_release_v2.caffemodel\n""  https://raw.githubusercontent.com/richzhang/colorization/master/colorization/models/colorization_deploy_v2.prototxt\n";const string keys ="{ h help |                                    | print this help message }""{ proto  | colorization_deploy_v2.prototxt    | model configuration }""{ model  | colorization_release_v2.caffemodel | model weights }""{ image  | house.jpg                          | path to image file }""{ opencl |                                    | enable OpenCL }";CommandLineParser parser(argc, argv, keys);parser.about(about);if (parser.has("help")){parser.printMessage();return 0;}string modelTxt = parser.get<string>("proto");string modelBin = parser.get<string>("model");string imageFile = parser.get<string>("image");bool useOpenCL = parser.has("opencl");if (!parser.check()){parser.printErrors();return 1;}Mat img = imread(imageFile, 1);if (img.empty()){cout << "Can't read image from file: " << imageFile << endl;return 2;}// fixed input size for the pretrained networkconst int W_in = 224;const int H_in = 224;Net net = dnn::readNetFromCaffe(modelTxt, modelBin);if (useOpenCL)net.setPreferableTarget(DNN_TARGET_OPENCL);//要求网络在特定目标设备上进行计算。// setup additional layers:设置其他图层int sz[] = { 2, 313, 1, 1 };const Mat pts_in_hull(4, sz, CV_32F, hull_pts);//四维矩阵Ptr<dnn::Layer> class8_ab = net.getLayer("class8_ab");//取出class8_ab层,对该层进行修改class8_ab->blobs.push_back(pts_in_hull);//作为blob存储的学习参数列表Ptr<dnn::Layer> conv8_313_rh = net.getLayer("conv8_313_rh");conv8_313_rh->blobs.push_back(Mat(1, 313, CV_32F, Scalar(2.606)));// extract L channel and subtract meanMat lab, L, input;img.convertTo(img, CV_32F, 1.0 / 255);cvtColor(img, lab, COLOR_BGR2Lab);extractChannel(lab, L, 0);//0代表通道索引resize(L, input, Size(W_in, H_in));//调整输入尺寸,与prototxt中输入层的参数一致input -= 50;//减平均值// run the L channel through the networkMat inputBlob = blobFromImage(input);net.setInput(inputBlob);Mat result = net.forward();//输出{1,2,56,56}四维Mat// retrieve the calculated a,b channels from the network outputSize sizz(result.size[0], result.size[1]);Size siz(result.size[2], result.size[3]);Mat a = Mat(siz, CV_32F, result.ptr(0, 0));//56*56Mat b = Mat(siz, CV_32F, result.ptr(0, 1));resize(a, a, img.size());resize(b, b, img.size());// merge, and convert back to BGRMat color, chn[] = { L, a, b };merge(chn, 3, lab);cvtColor(lab, color, COLOR_Lab2BGR);imshow("color", color);imshow("original", img);waitKey();return 0;
}

EAST深度学习文本检测器:

原文链接:https://www.colabug.com/4173878.html

 NMSBoxes函数在给定框和相应分数下执行非最大抑制:

void cv::dnn::NMSBoxes   (   const std::vector< Rect > &   bboxes,
const std::vector< float > &  scores,
const float     score_threshold,
const float     nms_threshold,
std::vector< int > &  indices,
const float     eta = 1.f,
const int   top_k = 0
)   

bboxes:一组矩形框。
scores:一组相应的置信度。
score_threshold:用于按分数过滤矩形框的阈值。
nms_threshold:用于非最大抑制的阈值。
indices:NMS后保留的bbox指数。
eta:自适应阈值公式中的系数:nms_thresholdi + 1 =eta⋅nms_thresholdi。

opencv实例:

#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/dnn.hpp>using namespace cv;
using namespace cv::dnn;const char* keys =
"{ help  h     | | Print help message. }"
"{ input i     | 1.jpg| Path to input image or video file. Skip this argument to capture frames from a camera.}"
"{ model m     |frozen_east_text_detection.pb | Path to a binary .pb file contains trained network.}"
"{ width       | 320 | Preprocess input image by resizing to a specific width. It should be multiple by 32. }"
"{ height      | 320 | Preprocess input image by resizing to a specific height. It should be multiple by 32. }"
"{ thr         | 0.5 | Confidence threshold. }"
"{ nms         | 0.4 | Non-maximum suppression threshold. }";void decode(const Mat& scores, const Mat& geometry, float scoreThresh,std::vector<RotatedRect>& detections, std::vector<float>& confidences);int main(int argc, char** argv)
{// Parse command line arguments.CommandLineParser parser(argc, argv, keys);parser.about("Use this script to run TensorFlow implementation (https://github.com/argman/EAST) of ""EAST: An Efficient and Accurate Scene Text Detector (https://arxiv.org/abs/1704.03155v2)");if (argc == 1 || parser.has("help")){parser.printMessage();//return 0;}float confThreshold = parser.get<float>("thr");//得分阈值float nmsThreshold = parser.get<float>("nms"); //非极大值抑制int inpWidth = parser.get<int>("width");int inpHeight = parser.get<int>("height");String model = parser.get<String>("model");if (!parser.check()){parser.printErrors();return 1;}CV_Assert(!model.empty());// Load network.Net net = readNet(model);// Open a video file or an image file or a camera stream.VideoCapture cap;if (parser.has("input"))cap.open(parser.get<String>("input"));elsecap.open(0);static const std::string kWinName = "EAST: An Efficient and Accurate Scene Text Detector";namedWindow(kWinName, WINDOW_NORMAL);std::vector<Mat> outs;std::vector<String> outNames(2);outNames[0] = "feature_fusion/Conv_7/Sigmoid";outNames[1] = "feature_fusion/concat_3";Mat frame, blob;while (waitKey(1) < 0){cap >> frame;if (frame.empty()){waitKey();break;}blobFromImage(frame, blob, 1.0, Size(inpWidth, inpHeight), Scalar(123.68, 116.78, 103.94), true, false);net.setInput(blob);net.forward(outs, outNames);Mat scores = outs[0];// 都是4维Mat geometry = outs[1];// Decode predicted bounding boxes.std::vector<RotatedRect> boxes;std::vector<float> confidences;decode(scores, geometry, confThreshold, boxes, confidences);//boxes是vector<RotatedRect>,confidences是得分// Apply non-maximum suppression procedure.应用非最大抑制std::vector<int> indices;NMSBoxes(boxes, confidences, confThreshold, nmsThreshold, indices);//indices存放保留下来的矩形框的索引// Render detections.Point2f ratio((float)frame.cols / inpWidth, (float)frame.rows / inpHeight);for (size_t i = 0; i < indices.size(); ++i){RotatedRect& box = boxes[indices[i]];Point2f vertices[4];box.points(vertices);for (int j = 0; j < 4; ++j){vertices[j].x *= ratio.x;vertices[j].y *= ratio.y;}for (int j = 0; j < 4; ++j)//画出矩形框line(frame, vertices[j], vertices[(j + 1) % 4], Scalar(0, 255, 0), 1);}// Put efficiency information.std::vector<double> layersTimes;double freq = getTickFrequency() / 1000;double t = net.getPerfProfile(layersTimes) / freq;std::string label = format("Inference time: %.2f ms", t);putText(frame, label, Point(0, 15), FONT_HERSHEY_SIMPLEX, 0.5, Scalar(0, 255, 0));imshow(kWinName, frame);}system("pause");return 0;
}void decode(const Mat& scores, const Mat& geometry, float scoreThresh,std::vector<RotatedRect>& detections, std::vector<float>& confidences)
{detections.clear();CV_Assert(scores.dims == 4); CV_Assert(geometry.dims == 4); CV_Assert(scores.size[0] == 1);CV_Assert(geometry.size[0] == 1); CV_Assert(scores.size[1] == 1); CV_Assert(geometry.size[1] == 5);CV_Assert(scores.size[2] == geometry.size[2]); CV_Assert(scores.size[3] == geometry.size[3]);const int height = scores.size[2];//1*1*80*80,存放每个像素的分数,与阈值比较const int width = scores.size[3];for (int y = 0; y < height; ++y){const float* scoresData = scores.ptr<float>(0, 0, y);//取一行const float* x0_data = geometry.ptr<float>(0, 0, y);//1*5*80*80存放的是矩形框吧const float* x1_data = geometry.ptr<float>(0, 1, y);const float* x2_data = geometry.ptr<float>(0, 2, y);const float* x3_data = geometry.ptr<float>(0, 3, y);const float* anglesData = geometry.ptr<float>(0, 4, y);for (int x = 0; x < width; ++x){float score = scoresData[x];if (score < scoreThresh)continue;// Decode a prediction.// Multiple by 4 because feature maps are 4 time less than input image.float offsetX = x * 4.0f, offsetY = y * 4.0f;float angle = anglesData[x];float cosA = std::cos(angle);float sinA = std::sin(angle);float h = x0_data[x] + x2_data[x];float w = x1_data[x] + x3_data[x];Point2f offset(offsetX + cosA * x1_data[x] + sinA * x2_data[x],offsetY - sinA * x1_data[x] + cosA * x2_data[x]);Point2f p1 = Point2f(-sinA * h, -cosA * h) + offset;Point2f p3 = Point2f(-cosA * w, sinA * w) + offset;RotatedRect r(0.5f * (p1 + p3), Size2f(w, h), -angle * 180.0f / (float)CV_PI);//定义矩形框detections.push_back(r);confidences.push_back(score);}}
}

身体姿势检测

https://github.com/CMU-Perceptual-Computing-Lab/openpose/tree/master/models

https://www.cnblogs.com/caffeaoto/p/7793994.html

//
//  this sample demonstrates the use of pretrained openpose networks with opencv's dnn module.
//
//  it can be used for body pose detection, using either the COCO model(18 parts):
//  http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/coco/pose_iter_440000.caffemodel
//  https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/openpose_pose_coco.prototxt
//
//  or the MPI model(16 parts):
//  http://posefs1.perception.cs.cmu.edu/OpenPose/models/pose/mpi/pose_iter_160000.caffemodel
//  https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/openpose_pose_mpi_faster_4_stages.prototxt
//
//  (to simplify this sample, the body models are restricted to a single person.)
//
//
//  you can also try the hand pose model:
//  http://posefs1.perception.cs.cmu.edu/OpenPose/models/hand/pose_iter_102000.caffemodel
//  https://raw.githubusercontent.com/CMU-Perceptual-Computing-Lab/openpose/master/models/hand/pose_deploy.prototxt
//#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace cv;
using namespace cv::dnn;#include <iostream>
using namespace std;// connection table, in the format [model_id][pair_id][from/to]
// please look at the nice explanation at the bottom of:
// https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/output.md
//
const int POSE_PAIRS[3][20][2] = {{   // COCO body{ 1,2 },{ 1,5 },{ 2,3 },{ 3,4 },{ 5,6 },{ 6,7 },{ 1,8 },{ 8,9 },{ 9,10 },{ 1,11 },{ 11,12 },{ 12,13 },{ 1,0 },{ 0,14 },{ 14,16 },{ 0,15 },{ 15,17 }},{   // MPI body{ 0,1 },{ 1,2 },{ 2,3 },{ 3,4 },{ 1,5 },{ 5,6 },{ 6,7 },{ 1,14 },{ 14,8 },{ 8,9 },{ 9,10 },{ 14,11 },{ 11,12 },{ 12,13 }},{   // hand{ 0,1 },{ 1,2 },{ 2,3 },{ 3,4 },         // thumb{ 0,5 },{ 5,6 },{ 6,7 },{ 7,8 },         // pinkie{ 0,9 },{ 9,10 },{ 10,11 },{ 11,12 },    // middle{ 0,13 },{ 13,14 },{ 14,15 },{ 15,16 },  // ring{ 0,17 },{ 17,18 },{ 18,19 },{ 19,20 }   // small} };int main(int argc, char **argv)
{CommandLineParser parser(argc, argv,"{ h help           | false | print this help message }""{ p proto          |    pose_deploy.prototxt   | (required) model configuration, e.g. hand/pose.prototxt }""{ m model          |   pose_iter_102000.caffemodel    | (required) model weights, e.g. hand/pose_iter_102000.caffemodel }""{ i image          |   hand.jpg    | (required) path to image file (containing a single person, or hand) }""{ width            |  368  | Preprocess input image by resizing to a specific width. }""{ height           |  368  | Preprocess input image by resizing to a specific height. }""{ t threshold      |  0.1  | threshold or confidence value for the heatmap }");String modelTxt = parser.get<string>("proto");String modelBin = parser.get<string>("model");String imageFile = parser.get<String>("image");int W_in = parser.get<int>("width");int H_in = parser.get<int>("height");float thresh = parser.get<float>("threshold");if (parser.get<bool>("help") || modelTxt.empty() || modelBin.empty() || imageFile.empty()){cout << "A sample app to demonstrate human or hand pose detection with a pretrained OpenPose dnn." << endl;parser.printMessage();return 0;}// read the network modelNet net = readNetFromCaffe(modelTxt, modelBin);// and the imageMat img = imread(imageFile);if (img.empty()){std::cerr << "Can't read image from the file: " << imageFile << std::endl;exit(-1);}// send it through the networkMat inputBlob = blobFromImage(img, 1.0 / 255, Size(W_in, H_in), Scalar(0, 0, 0), false, false);net.setInput(inputBlob);Mat result = net.forward();// the result is an array of "heatmaps", the probability of a body part being in location x,yint midx, npairs;int nparts = result.size[1];int H = result.size[2];int W = result.size[3];// find out, which model we haveif (nparts == 19){   // COCO bodymidx = 0;npairs = 17;nparts = 18; // skip background}else if (nparts == 16){   // MPI bodymidx = 1;npairs = 14;}else if (nparts == 22){   // handmidx = 2;npairs = 20;}else{cerr << "there should be 19 parts for the COCO model, 16 for MPI, or 22 for the hand one, but this model has " << nparts << " parts." << endl;return (0);}// find the position of the body partsvector<Point> points(22);for (int n = 0; n<nparts; n++){// Slice heatmap of corresponding body's part.Mat heatMap(H, W, CV_32F, result.ptr(0, n));//一张图片46*46// 1 maximum per heatmapPoint p(-1, -1), pm;double conf;minMaxLoc(heatMap, 0, &conf, 0, &pm);//最大值及所在坐标if (conf > thresh)p = pm;points[n] = p;}// connect body parts and draw it !float SX = float(img.cols) / W;float SY = float(img.rows) / H;for (int n = 0; n<npairs; n++){// lookup 2 connected body/hand partsPoint2f a = points[POSE_PAIRS[midx][n][0]];Point2f b = points[POSE_PAIRS[midx][n][1]];// we did not find enough confidence beforeif (a.x <= 0 || a.y <= 0 || b.x <= 0 || b.y <= 0)continue;// scale to image sizea.x *= SX; a.y *= SY;b.x *= SX; b.y *= SY;line(img, a, b, Scalar(0, 200, 0), 2);circle(img, a, 3, Scalar(0, 0, 200), -1);circle(img, b, 3, Scalar(0, 0, 200), -1);}imshow("OpenPose", img);waitKey();return 0;
}

OpenCV3.4.3DNN 模块中sample-colorization、Easy-textdetector、openpose相关推荐

  1. 从列表、字符串、元组或集合中随机抽取指定个元素 Python中random模块的sample()函数

    选择题 以下python代码的输出结果不可能为? from random import sample s = ['a','b','c','d'] result = sample(s,3) print( ...

  2. python中sample是什么意思_基于Python中random.sample()的替代方案

    python中random.sample()方法可以随机地从指定列表中提取出N个不同的元素,但在实践中发现,当N的值比较大的时候,该方法执行速度很慢,如: numpy random模块中的choice ...

  3. 05传智_jbpm与OA项目_部门模块中增加部门的jsp页面增加一个在线编辑器功能

    这篇文章讲的是在线编辑器功能,之前的部门模块中,增加部门的功能jsp页面起先是这么做的. 加入在线编辑器之后要达到的效果是: 采用一个插件,名为FCKeditor-v2.6.3.要理解一个插件,要先从 ...

  4. python random模块中的指令_python中random模块的使用

    这些方法位于random模块中 random.random(),同javascript的Math.random(),返回[0.0,1)之间的浮点数 random.uniform(a, b),返回[a, ...

  5. OpenCV3的GPU模块编译

    [摘要] OpenCV3的GPU模块需要手动重新编译才可以使用.本文介绍了编译OpenCV3 + GPU模块的方法. [本文使用的操作系统.软件版本] OS:Windows10 OpenCV 3.0. ...

  6. simulink中sample based和frame based的区别

    simulink中sample based和frame based的区别 在Matlab的simulink仿真中会用到各种上插下抽模块,模块中有一个sample based和frame based,花 ...

  7. Iar环境c语言调用汇编函数,如何在IAR EWARM中通过内联汇编程序在另一个模块中调用C函数?...

    我在硬故障处理程序中有一些程序集.程序集基本上是为了传递当前堆栈指针作为参数(在R0中).它看起来像这样...如何在IAR EWARM中通过内联汇编程序在另一个模块中调用C函数? __asm(&quo ...

  8. 现在无法开始异步操作。异步操作只能在异步处理程序或模块中开始,或在页生存期中的特定事件过程中开始...

    异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 这篇没啥技术含量,用来小记一番 错误信息 "System.Invalid ...

  9. 爬虫之lxml模块中etree.tostring函数的使用

    爬虫之lxml模块中etree.tostring函数的使用 运行下边的代码,观察对比html的原字符串和打印输出的结果 from lxml import etree html_str = ''' &l ...

最新文章

  1. 中国组合聚醚市场十四五发展规划与未来竞争趋势分析报告2022-2028年版
  2. 工业级光纤收发器使用“避坑”指南
  3. IOC操作Bean管理注解方式(完全注解开发)
  4. np.random的随机数函数
  5. js实现sleep休眠
  6. 理解 invokedynamic
  7. 安卓模拟器切换横屏之后怎么返回竖屏
  8. 测试通用串行总线控制器好坏软件,通用串行总线控制器出现叹号是什么情况?怎么解决?...
  9. 谷歌等质问IETF:IPv6的用户在哪里?
  10. 字典排序 python3_这10个字典操作你必须知道
  11. 多级联动(已知和未知级次)
  12. 硬件 JavaScript - 一个【电阻分压器 - 计算器】
  13. MATLAB零基础入门教程视频课程
  14. ODI升级连接mysql数据库的驱动
  15. [Android]SQLite版本升级前后数据对比
  16. Discuz!教程之当插件、门户或自定义页面设置成首页时手机版访问跳转到forum.php?mobile=yes的问题
  17. 逍遥模拟器连接不到android,逍遥模拟器不能连上网怎么办?两招解决问题
  18. UDA一致正则化和熵最小化
  19. 微服架构基础设施环境平台搭建 -(一)基础环境准备
  20. css水墨背景,PS古风水墨背景教程

热门文章

  1. mysql数据库varchar_MySQL数据库char与varchar的区别分析及使用建议
  2. 信安教程第二版-第15章网络安全主动防御技术与应用
  3. 千兆网线8根线定义图_网线水晶头如何制作及怎么测试?
  4. 1.通俗解释分布式系统
  5. js中setInterval与setTimeout的区别
  6. Android 程式开发:(二十)内容提供者 —— 20.6 自定义ContentProvider的使用
  7. Ios 被拒出现3.1.1
  8. 求1e11以内的素数
  9. 白话经典算法系列之——希尔排序的实现
  10. issues:close 云端 STS 启动报找不到 jdk