Skip to content

Commit c74f9fd

Browse files
committed
G
G
1 parent e7ea742 commit c74f9fd

18 files changed

+33741
-9
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
{
2+
"python.pythonPath": "/usr/local/anaconda/bin/python",
3+
"python.formatting.provider": "autopep8"
24
}

.vscode/tasks.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@
66
{
77
"label": "Run File",
88
"command": "${config:python.pythonPath} ${file}",
9-
// "command": "python ${file}",
109
"type": "shell",
11-
"group": {
12-
"kind": "build",
13-
"isDefault": true
14-
},
10+
"group": "build",
1511
"presentation": {
1612
"reveal": "always",
1713
"panel": "new",
@@ -20,10 +16,11 @@
2016
},
2117
{
2218
"label": "nosetest",
23-
"command": "nosetests -v",
19+
// "command": "nosetests -v",
20+
"command": "${config:python.pythonPath} ${file}",
2421
"type": "shell",
2522
"group": {
26-
"kind": "test",
23+
"kind": "build",
2724
"isDefault": true
2825
},
2926
"presentation": {

DL_TensorFlow/ch1_tensorflow_intro.py

Whitespace-only changes.

DL_TensorFlow/ch2_tensorflow_intr.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# -*- coding: utf-8 -*-
2+
3+
import tensorflow as tf
4+
5+
hello = tf.constant("Hello Tensorflow")
6+
sess = tf.Session()
7+
cont = sess.run(hello)
8+
print(cont)
9+
sess.close()
10+
11+
12+
a = tf.constant(3)
13+
b = tf.constant(4)
14+
with tf.Session() as sess:
15+
res = sess.run(a+b)
16+
print(res)
17+
18+
19+
# 演示注入机制
20+
a = tf.placeholder(tf.int16)
21+
b = tf.placeholder(tf.int16)
22+
add = tf.add(a, b)
23+
mul = tf.multiply(a, b)
24+
25+
with tf.Session() as sess:
26+
print("add: {}".format(sess.run(add, feed_dict={a:3, b:4})))
27+
print("mul: {}".format(sess.run(mul, feed_dict={a:5, b:9})))
28+
# 使用注入机制获取节点
29+
print(sess.run([mul, add], feed_dict={a:5, b:3}))

E:\0.jpg

Loading

E:\dev_sm.jpg

Loading

ImageProcessing/face_detect.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!usr/bin/env python
2+
# -*- coding:utf -8-*-
3+
# Author: jinjun.gui
4+
# Date: 2019-03-07
5+
6+
7+
import cv2 as cv
8+
import numpy as np
9+
10+
# recognizer = cv2.face.LBPHFaceRecognizer_create()
11+
detector = cv.CascadeClassifier('haarcascade_frontalface_default.xml')
12+
cap = cv.VideoCapture(0)
13+
# 从摄像头获取到图像
14+
ret, img = cap.read()
15+
# 展示图片,第一个参数表示窗口名称,第二个是要展示的图片.
16+
cv.imshow('windowname', img)
17+
# 停留展示界面,6000毫秒,0表示一直停留着.
18+
cv.waitKey(3000)
19+
# 释放摄像头资源
20+
cap.release()
21+
# 将图片先转换为灰度图片
22+
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
23+
print(gray)
24+
faces = detector.detectMultiScale(gray, 1.3, 5)
25+
print(faces)
26+
27+
for (x, y, w, h) in faces:
28+
cv.rectangle(img, (x,y), (x+w, y+h), (255, 0, 0), 2)
29+
30+
31+
32+
33+
# detector = cv.CascadeClassifier('haarcascade_frontalface_default.xml')
34+
# cap = cv.VideoCapture(0)
35+
36+
# while True:
37+
# ret, img = cap.read()
38+
# gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
39+
# faces = detector.detectMultiScale(gray, 1.3, 5)
40+
# for (x, y, w, h) in faces:
41+
# cv.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2)
42+
43+
# cv.imshow('frame', img)
44+
# if cv.waitKey(1) & 0xFF == ord('q'):
45+
# break
46+
47+
48+
# cap.release()
49+
# cv.destroyAllWindows()

0 commit comments

Comments
 (0)