自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

我的英文站点:https://iorilan.medium.com/

编码要踏实 架构要落地

  • 博客(1201)
  • 资源 (6)
  • 收藏
  • 关注

原创 Javascript 从ES5到ES7总结 - 2 array-set-map-1

/*Array*/// foreacharray = ['first', 'second', undefined, 'fourth'];array.forEach(function(element) {  console.log(element);});var myArray = new Array('1', '2', '3');myArray = myArray.con...

2019-02-05 15:20:09 449

原创 Javascript 从ES5到ES7总结 - 1 对象

var person = { name: ['Bob', 'Smith'], age: 32, gender: 'male', interests: ['music', 'skiing'], bio: function() { alert(this.name[0] + ' ' + this.name[1] + ' is ' + this.age + ' years o...

2019-02-05 15:18:56 401

原创 linux 杀死指定进程名称

PID=`pgrep node`echo {password} |sudo -S kill $PID 

2019-01-27 19:07:54 1525

原创 使用winser将nodejs 安装为windows 服务

1.npm install winser2. package.json : "scripts": {    "install-windows-service": "winser -i",    "uninstall-windows-service": "winser -r"  }  3.for install:npm run-script install-w...

2019-01-27 19:04:57 584

原创 javascript 使用fetch完成get和post

get :fetch (url).then(...);or var result = await fetch(url);post :getDevices = async () => {    const location = window.location.hostname;    const settings = {        method: 'PO...

2019-01-27 19:02:43 5683

原创 javascript 拷贝字符串到剪切板

const copyToClipboard = str => {        const el = document.createElement('textarea');          el.value = str;                                        el.setAttribute('readonly', '');          ...

2019-01-27 19:01:07 1184

原创 安卓获取唯一标识

String androidID = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);注意:这个ID在恢复出厂设置会刷新。

2019-01-27 18:59:17 738

原创 Js 跨 iframe 通信

方法:使用window的消息队列。1. iframe A, 订阅 window.addEventListener("message", function (event) {        console.log("new window message");        switch (event.data.msg) {        case 'a': ... break;  ...

2019-01-27 18:56:26 771

原创 使用Python 训练OpenCV Cascade分类器 - 5

测试。本例使用了3个opencv的分类器:haarcascade_frontalface_alt和haarcascade_eye是自带的。分别识别人脸和人眼。还有一个是cascade,也就是自己训练出来的分类器。此处测试取决于在这一步传给OPENCV的图片参数,也就是你想要识别的特征图(本例为手表):opencv_createsamples.exe -img watch5050.jpg -b...

2019-01-19 22:02:13 3254 1

原创 使用Python 训练OpenCV Cascade分类器 - 4

创建positive和negative样本。import cv2import numpy as npimport osdef create_pos_n_neg():    for file_type in ['neg']:                for img in os.listdir(file_type):            if file_type == '...

2019-01-19 21:53:46 1168

原创 使用Python 训练OpenCV Cascade分类器 - 3

这一步是筛选掉不符合条件的图。 import cv2import numpy as npimport osdef find_uglies():    match = False    for file_type in ['neg']:        for img in os.listdir(file_type):            for ugly in os.lis...

2019-01-19 21:52:49 816

原创 使用Python 训练OpenCV Cascade分类器 - 2

 从imagenet下载测试图片。中间会使用cv2来处理图片大小。import urllib.requestimport cv2import numpy as npimport osdef store_raw_images():#http://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n04194289 ...

2019-01-19 21:51:37 756

原创 使用Python 训练OpenCV Cascade分类器 - 1

当然前提是你已经匹配好了open cv。本文就不赘述了,推荐linux环境。0. image net urls : 下载图片样本的链接:http://image-net.org/download-imageurlshttp://www.image-net.org/api/text/imagenet.synset.geturls?wnid=n041942891. create sampl...

2019-01-19 21:50:10 2100

原创 使用Python face_recognition 人脸识别 - 14 创建人脸识别1-1比对web服务

本例是对前一篇的web服务进行的一个扩展:接受两张上传的图片,判断上传的照片是否为同一个人。实现:# this sample is to compare if the 2 input photo is the same personimport face_recognitionfrom flask import Flask, jsonify, request, redirect...

2019-01-19 21:41:16 561

原创 使用Python face_recognition 人脸识别 - 13 创建一个web 服务识别上传的图片是否包含人脸

本例使用的是轻量的web框架flask。制作web服务一个attribute 搞定。python3的安装: pip3 install flask实现代码:import face_recognitionfrom flask import Flask, jsonify, request, redirect# You can change this to any folder on...

2019-01-19 21:38:59 1157 1

原创 使用Python face_recognition 人脸识别 - 12 人脸图片1-N比对

示例说明:准备一张(或非)人脸图片,准备多张已知人脸图片数组。进行1-N比对。如果人脸存在,打印出人名;否则打印出没有找到人脸。例子中把路径写死了,真实应用可以考虑从远程获取人脸信息并生成临时目录进行比对。import face_recognition# Load the jpg files into numpy arraysbiden_image = face_recognition...

2019-01-19 21:34:29 1932

原创 使用Python face_recognition 人脸识别 - 11 识别出人脸并以矩形标记

图片库使用的还是PIL,用来highlight出识别的人脸。 import face_recognitionfrom PIL import Image, ImageDraw# This is an example of running face recognition on a single image# and drawing a box around each person th...

2019-01-19 21:30:36 1345

原创 使用Python face_recognition 人脸识别 - 10 解析一个视频文件中的人脸

示例说明:输入一个MP4文件,准备两张已知的人脸PNG照片,一旦找到匹配,弹出识别出的人脸照片。 import face_recognitionimport cv2# This is a demo of running face recognition on a video file and saving the results to a new video file.## P...

2019-01-19 21:29:06 1662

原创 使用Python face_recognition 人脸识别 - 9 从照片出抓出所有人脸属性

 from PIL import Image, ImageDrawimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_file("./images/two_people.jpg")# Find all facial features in ...

2019-01-19 21:26:35 814

原创 使用Python face_recognition 人脸识别 - 8 判断一张照片中是否存在人脸

face_recognition结合PIL库来判断指定路径的照片是否能抓出人脸。模型使用的是HOG(默认实现),下面的CNN的实现会更准确一些。from PIL import Imageimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_fil...

2019-01-19 21:22:37 3541

原创 使用Python face_recognition 人脸识别 - 7 使用knn分类器

结合python的face_recognition的knn的实现。训练过程使用的是scikit-learn。 import mathfrom sklearn import neighborsimport osimport os.pathimport picklefrom PIL import Image, ImageDrawimport face_recognitionf...

2019-01-19 21:21:03 1713 1

原创 使用Python face_recognition 人脸识别 - 6 从webcam中获取人脸

如果你使用的是VMWARE的ubuntu,需要以下配置来允许VM访问笔记本摄像头驱动:1. make sure vm-> settings -> USB capitability is 1.12. run commandssudo apt-get install cheese build-essential linux-headers-`uname -r`sudo apt-...

2019-01-19 21:16:23 823 1

原创 使用Python face_recognition 人脸识别 - 5 人脸比对并打分

比对两张人脸编码后的照片,打印出相似度。 import face_recognition# Often instead of just checking if two faces match or not (True or False), it's helpful to see how similar they are.# You can do that by using the...

2019-01-19 21:10:51 3868

原创 使用Python face_recognition 人脸识别 - 4 标记出人脸属性

from PIL import Image, ImageDrawimport face_recognition# Load the jpg file into a numpy arrayimage = face_recognition.load_image_file("./images/biden.jpg")# Find all facial features in all the ...

2019-01-19 21:08:57 1235

原创 使用Python face_recognition 人脸识别 - 3 识别人脸轮廓并编码

import timeit# Note: This example is only tested with Python 3 (not Python 2)# This is a very simple benchmark to give you an idea of how fast each step of face recognition will run on your syste...

2019-01-19 21:06:14 951

原创 使用Python face_recognition 人脸识别 - 2 人脸1-1比对

导入face_recognition库,直接比对两张人脸照片:import face_recognitionknown_image = face_recognition.load_image_file("./images/biden.jpg")unknown_image = face_recognition.load_image_file("./images/unknown.jpg")...

2019-01-19 21:04:52 852

原创 使用Python face_recognition 人脸识别 - 1

在ubuntu环境配置步骤:sudo apt-get updatesudo apt-get install build-essential cmakesudo apt-get install libopenblas-dev liblapack-dev sudo apt-get install libx11-dev libgtk-3-devsudo apt-get install py...

2019-01-19 21:02:21 501

原创 软件项目一直赶工期,越改越忙,怎么破?

赶项目工期通常带来的是代码质量的下降。但如果项目截止日期已成定局,眼前最要紧的是快速写出可以维护的代码。编码过程关注的优先级笔者认为是:1可读性>2内聚性>3可配置性>4扩展性>5性能>6可测试性>7代码依赖>8自动化,AI前4保证可以在质量可维护的前提下如期交付,然后考虑性能等属性。重中之重必然是可读性。代码虽然是给机器执行的,但是给人读的,...

2019-01-13 23:44:39 1989

原创 ubuntu配置ssh服务

1.sudo useradd -s /sbin/nologin -M sftpuser2.sudo passwd sftpkeeperlog3. cd /etc/init.d/4.sudo sshd start5.open /etc/ssh/sshd_config file , open.6. find 'PasswordAuthentication',set to 'ye...

2019-01-08 23:23:31 1426 1

原创 ubuntu 安装python3和open cv

sudo apt-get install libopencv-dev python-opencvsudo pip3 install opencv-python在windows(坑多,不推荐):python -m pip install opencv-python 

2019-01-08 23:22:29 718

原创 C# EF动态获取连接字符串的MSDTC配置

用于需要动态获取链接字符串(比如从配置中心)获取数据源地址然后链接数据库的情形,需要在服务器上配置MSDTC。以下是动态链接数据库的代码 using (var ctx = new YourDbContextWhereCanFindConnectionString()) {                ...                 var record = "your co...

2019-01-08 23:20:57 1342 1

原创 html5 JS 循环播放多个视频源

 ... var video_list    = [url1,url2];                                    var video_index    = 0;                                    var video_player   = null;                                    ...

2019-01-08 23:16:30 2184 1

原创 C# 借助bitmap进行RGB颜色比对

public static bool IsBlankImage(byte[] imageData)        {            //some image color :#C49A6A, rgb(196,154,106)            var colorBlank = Color.FromArgb(196, 154, 106);            using (va...

2019-01-08 23:14:48 2049

原创 c# 使用7zip

1. 7zip 使用密码来压缩C:\"Program Files"\7-Zip\7z.exe a -t7z D:\path\to\your\zip\files.zipD:\path\to\your\1.csv -pSECRET2. 使用密码来解压 (提取到当前目录)C:\"Program Files"\7-Zip\7z.exe e -t7z D:\path\to\your\zip\fi...

2019-01-08 23:13:30 2768 1

原创 使用.NET SFTP 登陆linux上传下载文件

1. 从这里下载https://github.com/sshnet/SSH.NET2. 使用wrapper 类...public static IList<string> SearchLogs(DateTime fromDate, DateTime toDate)        {            var path = Config.LogPath;     ...

2019-01-08 23:10:58 773

原创 Azure部署nodejs webapp服务无法启动常见原因

0. 在 azure的webapp的 appsetting中添加nodejs版本号WEBSITE_NODE_DEFAULT_VERSION, {nodejsVersion}1.使用azure 的debug console来调试:https://yourapp.scm.azurewebsites.net/DebugConsole2. 尝试显示指定node的版本号 :"engines":...

2019-01-08 23:08:52 1308

原创 python ubuntu dlib 人脸识别11-物体追踪

1. 从文件夹中读取图片文件,这步可以结合ffmpeg来完成,将视频流切图命令为(但需要再写个脚本定期清理旧图片,比如10分钟前):ffmpeg -i myfile.avi -r 1000 -f image2 image-%07d.png2.读取图片并圈出识别出的物体:import osimport globimport dlib# Path to the video ...

2018-12-02 15:58:15 598 1

原创 python ubuntu dlib 10- 生成自然语言向量

import sysimport dlib计算特征向量:def sentence_to_vectors(sentence): # Create an empty array of vectors vects = dlib.vectors() for word in sentence.split(): # Our vectors are very...

2018-12-02 15:48:29 422

原创 python Ubuntu dlib 人脸识别9-辅助函数

全局优化函数:import dlibfrom math import sin,cos,pi,exp,sqrt# This is a standard test function for these kinds of optimization problems.# It has a bunch of local minima, with the global minimum resul...

2018-12-02 15:38:24 474

原创 python ubuntu dlib 8- 输出人脸坐标

输入图片检测人脸,输出人脸坐标import sysimport dlibif len(sys.argv) < 1: print("need specify the image file") exit()image_file = sys.argv[1]img = dlib.load_rgb_image(image_file)# Locations of candidat...

2018-12-02 15:28:20 638

锋利的jquery PDF带书签目录完整版

《锋利的jQuery》高清扫描PDF带书签目录完整版+源码,特此分享,学习愉快!

2011-05-23

java 多线程下载 (单文件)

演示了JAVA中的多线程 界面简单 需要请拿去

2009-06-12

socket 通信 简单示例

演示了socket在C#中的基本用法,初学者拿去

2009-06-12

J2ME 小游戏(多线程操作示例)

多线程实现的,原理很简单,这个游戏只是多线程的一个示例,没有多大的娱乐功能,学习J2ME的新手可以拿去~~

2009-04-13

《编译原理与实践》(孙悦红)答案

前一段给这本书的作者发了个邮件~感觉做作业困难,想要答案~没过两天这个作者就给我发来了~好作者~~拿来跟大家分享一下~有需要的拿去~

2009-04-13

C# 简单的聊天程序

c#写的 适合初学者,我也是刚接触SOCKET通信,拿出来给SOCKET初学者分享一下 。

2009-03-28

空空如也

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

TA关注的人

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