This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[net] | |
# Testing | |
batch=16 | |
subdivisions=16 | |
# Training | |
# batch=64 | |
# subdivisions=2 | |
width=416 | |
height=416 | |
channels=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[net] | |
# Testing | |
# batch=1 | |
# subdivisions=1 | |
# Training | |
batch=16 | |
subdivisions=16 | |
width=288 # input image resolution in width | |
height=288 # input image resolution in height | |
channels=3 # color space of input image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
# 載入分類器 | |
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
# 讀取圖片 | |
img = cv2.imread('a.jpg') | |
# 轉成灰階圖片 | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
# 偵測臉部 | |
faces = face_cascade.detectMultiScale( | |
gray, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
# 載入分類器 | |
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
# 從視訊鏡頭擷取影片. | |
#cap = cv2.VideoCapture(0) | |
# 使用現有影片 | |
cap = cv2.VideoCapture('test.mp4') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def lineNotifyMessage(token, msg): | |
headers = { | |
"Authorization": "Bearer " + token, | |
"Content-Type" : "application/x-www-form-urlencoded" | |
} | |
payload = {'message': msg} | |
r = requests.post("https://notify-api.line.me/api/notify", headers = headers, params = payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /home/e96031413/PiToTX2/video/*.mp4 /home/e96031413/AlexeyAB/darknet/data/bird/video/ | |
cp -a /home/e96031413/PiToTX2/image/. /home/e96031413/AlexeyAB/darknet/data/bird/image | |
#./darknet detector test cfg/voc.data cfg/yolov3.cfg yolov3_10000.weights data/bird/image/bird.jpg | tee predict_img_result.txt | sleep 1s ; kill $! | |
./darknet detector demo cfg/voc.data cfg/yolov3.cfg yolov3_10000.weights data/bird/video/test.mp4 -out_filename detect-result.avi | sleep 120s ; kill $! | |
youtube-upload --title="video from tx2" detect-result.avi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[net] | |
# Testing | |
batch=16 | |
subdivisions=16 | |
# Training | |
# batch=64 | |
# subdivisions=2 | |
width=416 | |
height=416 | |
channels=3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
options = Options() | |
#關閉瀏覽器跳出訊息 | |
prefs = { | |
'profile.default_content_setting_values' : | |
{ | |
'notifications' : 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#only for pip >= 10.0.1 | |
#for pip < 10.0.1, please upgrade your pip version with the following code | |
'''python -m pip install --user --upgrade pip''' | |
import pkg_resources | |
from subprocess import call | |
packages = [dist.project_name for dist in pkg_resources.working_set] | |
call("pip install --upgrade " + ' '.join(packages), shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32com.client | |
speaker = win32com.client.Dispatch("SAPI.SpVoice") | |
while 1: | |
print('Enter the Word') | |
#可用中文、英文 | |
s = input( ) | |
speaker.Speak(s) |
OlderNewer