fix buzzer
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import aip
|
||||
|
||||
import os
|
||||
|
||||
|
||||
f = open("audio.mp3", 'wb')
|
||||
client = aip.AipSpeech("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
f.write(client.synthesis("步行导航开始,直行后前方50米右转", options={}))
|
||||
os.startfile("audio.mp3")
|
||||
@@ -0,0 +1,8 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipSpeech("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.asr(f.read(), options={})["result"][0])
|
||||
@@ -0,0 +1,9 @@
|
||||
import audio
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
audio.audio_record("d:\\1.wav",3)
|
||||
f = open("d:\\1.wav", 'rb')
|
||||
client = aip.AipSpeech("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.asr(f.read(), options={})["result"][0])
|
||||
@@ -0,0 +1,8 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipImageClassify("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.advancedGeneral(f.read(), options={})["result"][0]["keyword"])
|
||||
@@ -0,0 +1,9 @@
|
||||
import aip
|
||||
|
||||
import FileDialog
|
||||
|
||||
|
||||
client = aip.AipImageClassify("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
for i in FileDialog.getManyFiles():
|
||||
f = open(i, 'rb')
|
||||
print(client.advancedGeneral(f.read(), options={})["result"][0]["keyword"])
|
||||
@@ -0,0 +1,7 @@
|
||||
import aip
|
||||
|
||||
import FileDialog
|
||||
|
||||
|
||||
client = aip.AipFace("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.match(FileDialog.getOneFile(),FileDialog.getOneFile(), options={})["score"])
|
||||
10
boards/default/python_mixpy/examples/pu5oovP6zx4/05人脸识别-2.py
Normal file
10
boards/default/python_mixpy/examples/pu5oovP6zx4/05人脸识别-2.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import aip
|
||||
|
||||
import cam
|
||||
|
||||
import FileDialog
|
||||
|
||||
|
||||
client = aip.AipFace("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
cam.photo_capture("d:\\1.jpg","q")
|
||||
print(client.match(FileDialog.getOneFile(),FileDialog.getOneFile(), options={})["score"])
|
||||
@@ -0,0 +1,8 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipOcr("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.basicGeneral(f.read(), options={}))
|
||||
@@ -0,0 +1,9 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipOcr("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
list = client.basicGeneral(f.read(), options={})["words_result"]
|
||||
print(list)
|
||||
@@ -0,0 +1,8 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipOcr("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.licensePlate(f.read(), options={}))
|
||||
11
boards/default/python_mixpy/examples/pu5oovP6zx4/07拓展发现-2.py
Normal file
11
boards/default/python_mixpy/examples/pu5oovP6zx4/07拓展发现-2.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import FileDialog
|
||||
|
||||
import aip
|
||||
|
||||
|
||||
f = open(FileDialog.getOneFile(), 'rb')
|
||||
f2 = open(FileDialog.getOneFile(), 'rb')
|
||||
client = aip.AipOcr("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
client2 = aip.AipImageClassify("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.licensePlate(f.read(), options={})["words_result"]["number"])
|
||||
print(client2.carDetect(f2.read(), options={}))
|
||||
@@ -0,0 +1,5 @@
|
||||
import aip
|
||||
|
||||
|
||||
client = aip.AipNlp("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
print(client.ecnet("促进创客教育与本地新形产业的整合,促进当地经济的发展。", options={}))
|
||||
10
boards/default/python_mixpy/examples/pu5oovP6zx4/08文本纠错-2.py
Normal file
10
boards/default/python_mixpy/examples/pu5oovP6zx4/08文本纠错-2.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import aip
|
||||
|
||||
|
||||
client = aip.AipNlp("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
result = client.ecnet("促进创客教育与本地新形产业的整合,促进当地经济的发展。", options={})
|
||||
content = result["text"]
|
||||
item = result["item"]
|
||||
wrong = item["vec_fragment"][0]["ori_frag"]
|
||||
right = item["vec_fragment"][0]["correct_frag"]
|
||||
print(content.replace(wrong,"{}【{}】".format(wrong, right)))
|
||||
10
boards/default/python_mixpy/examples/pu5oovP6zx4/09词法分析-1.py
Normal file
10
boards/default/python_mixpy/examples/pu5oovP6zx4/09词法分析-1.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import aip
|
||||
|
||||
|
||||
client = aip.AipNlp("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
s = ""
|
||||
for i in client.lexer("我爱米思齐", options={})["items"]:
|
||||
if s != "":
|
||||
s = s + "/"
|
||||
s = s + i["item"]
|
||||
print(s)
|
||||
12
boards/default/python_mixpy/examples/pu5oovP6zx4/09词法分析-2.py
Normal file
12
boards/default/python_mixpy/examples/pu5oovP6zx4/09词法分析-2.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import aip
|
||||
|
||||
|
||||
client = aip.AipNlp("Enter Your APP_ID", "Enter Your API_KEY", "Enter Your SECRET_KEY")
|
||||
word= {"r":"代词", "v":"动词", "nr":"名词"}
|
||||
s = ""
|
||||
for i in client.lexer("我爱米思齐", options={})["items"]:
|
||||
s = s + i["item"]
|
||||
s = s + "【"
|
||||
s = s + word[i["pos"]]
|
||||
s = s + "】"
|
||||
print(s)
|
||||
Reference in New Issue
Block a user