smartpi 1.1.4__py3-none-any.whl → 1.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartpi/__init__.py +8 -0
- smartpi/__init__.pyc +0 -0
- smartpi/_gui.py +66 -0
- smartpi/_gui.pyc +0 -0
- smartpi/ai_asr.py +1037 -0
- smartpi/ai_asr.pyc +0 -0
- smartpi/ai_llm.py +934 -0
- smartpi/ai_llm.pyc +0 -0
- smartpi/ai_tts.py +938 -0
- smartpi/ai_tts.pyc +0 -0
- smartpi/ai_vad.py +83 -0
- smartpi/ai_vad.pyc +0 -0
- smartpi/audio.py +125 -0
- smartpi/audio.pyc +0 -0
- smartpi/base_driver.py +618 -0
- smartpi/base_driver.pyc +0 -0
- smartpi/camera.py +84 -0
- smartpi/camera.pyc +0 -0
- smartpi/color_sensor.py +18 -0
- smartpi/color_sensor.pyc +0 -0
- smartpi/cw2015.py +179 -0
- smartpi/cw2015.pyc +0 -0
- smartpi/flash.py +130 -0
- smartpi/flash.pyc +0 -0
- smartpi/humidity.py +20 -0
- smartpi/humidity.pyc +0 -0
- smartpi/led.py +19 -0
- smartpi/led.pyc +0 -0
- smartpi/light_sensor.py +72 -0
- smartpi/light_sensor.pyc +0 -0
- smartpi/local_model.py +432 -0
- smartpi/local_model.pyc +0 -0
- smartpi/mcp_client.py +100 -0
- smartpi/mcp_client.pyc +0 -0
- smartpi/mcp_fastmcp.py +322 -0
- smartpi/mcp_fastmcp.pyc +0 -0
- smartpi/mcp_intent_recognizer.py +408 -0
- smartpi/mcp_intent_recognizer.pyc +0 -0
- smartpi/models/__init__.py +0 -0
- smartpi/models/__init__.pyc +0 -0
- smartpi/models/snakers4_silero-vad/__init__.py +0 -0
- smartpi/models/snakers4_silero-vad/__init__.pyc +0 -0
- smartpi/models/snakers4_silero-vad/hubconf.py +56 -0
- smartpi/models/snakers4_silero-vad/hubconf.pyc +0 -0
- smartpi/motor.py +177 -0
- smartpi/motor.pyc +0 -0
- smartpi/move.py +218 -0
- smartpi/move.pyc +0 -0
- smartpi/onnx_hand_workflow.py +201 -0
- smartpi/onnx_hand_workflow.pyc +0 -0
- smartpi/onnx_image_workflow.py +176 -0
- smartpi/onnx_image_workflow.pyc +0 -0
- smartpi/onnx_pose_workflow.py +482 -0
- smartpi/onnx_pose_workflow.pyc +0 -0
- smartpi/onnx_text_workflow.py +173 -0
- smartpi/onnx_text_workflow.pyc +0 -0
- smartpi/onnx_voice_workflow.py +437 -0
- smartpi/onnx_voice_workflow.pyc +0 -0
- smartpi/posemodel/__init__.py +0 -0
- smartpi/posemodel/__init__.pyc +0 -0
- smartpi/posenet_utils.py +222 -0
- smartpi/posenet_utils.pyc +0 -0
- smartpi/rknn_hand_workflow.py +245 -0
- smartpi/rknn_hand_workflow.pyc +0 -0
- smartpi/rknn_image_workflow.py +405 -0
- smartpi/rknn_image_workflow.pyc +0 -0
- smartpi/rknn_pose_workflow.py +592 -0
- smartpi/rknn_pose_workflow.pyc +0 -0
- smartpi/rknn_text_workflow.py +240 -0
- smartpi/rknn_text_workflow.pyc +0 -0
- smartpi/rknn_voice_workflow.py +394 -0
- smartpi/rknn_voice_workflow.pyc +0 -0
- smartpi/servo.py +178 -0
- smartpi/servo.pyc +0 -0
- smartpi/temperature.py +18 -0
- smartpi/temperature.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/__init__.py +1 -0
- smartpi/tencentcloud-speech-sdk-python/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/asr/__init__.py +0 -0
- smartpi/tencentcloud-speech-sdk-python/asr/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/asr/flash_recognizer.py +178 -0
- smartpi/tencentcloud-speech-sdk-python/asr/flash_recognizer.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/asr/speech_recognizer.py +311 -0
- smartpi/tencentcloud-speech-sdk-python/asr/speech_recognizer.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/common/__init__.py +1 -0
- smartpi/tencentcloud-speech-sdk-python/common/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/common/credential.py +6 -0
- smartpi/tencentcloud-speech-sdk-python/common/credential.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/common/log.py +16 -0
- smartpi/tencentcloud-speech-sdk-python/common/log.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/common/utils.py +7 -0
- smartpi/tencentcloud-speech-sdk-python/common/utils.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/soe/__init__.py +0 -0
- smartpi/tencentcloud-speech-sdk-python/soe/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/soe/speaking_assessment.py +276 -0
- smartpi/tencentcloud-speech-sdk-python/soe/speaking_assessment.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/tts/__init__.py +0 -0
- smartpi/tencentcloud-speech-sdk-python/tts/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/tts/flowing_speech_synthesizer.py +294 -0
- smartpi/tencentcloud-speech-sdk-python/tts/flowing_speech_synthesizer.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/tts/speech_synthesizer.py +144 -0
- smartpi/tencentcloud-speech-sdk-python/tts/speech_synthesizer.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/tts/speech_synthesizer_ws.py +234 -0
- smartpi/tencentcloud-speech-sdk-python/tts/speech_synthesizer_ws.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/vc/__init__.py +0 -0
- smartpi/tencentcloud-speech-sdk-python/vc/__init__.pyc +0 -0
- smartpi/tencentcloud-speech-sdk-python/vc/speech_convertor_ws.py +237 -0
- smartpi/tencentcloud-speech-sdk-python/vc/speech_convertor_ws.pyc +0 -0
- smartpi/text_gte_model/__init__.py +0 -0
- smartpi/text_gte_model/__init__.pyc +0 -0
- smartpi/text_gte_model/config/__init__.py +0 -0
- smartpi/text_gte_model/config/__init__.pyc +0 -0
- smartpi/text_gte_model/gte/__init__.py +0 -0
- smartpi/text_gte_model/gte/__init__.pyc +0 -0
- smartpi/touch_sensor.py +16 -0
- smartpi/touch_sensor.pyc +0 -0
- smartpi/trace.py +120 -0
- smartpi/trace.pyc +0 -0
- smartpi/ultrasonic.py +20 -0
- smartpi/ultrasonic.pyc +0 -0
- {smartpi-1.1.4.dist-info → smartpi-1.1.5.dist-info}/METADATA +3 -2
- smartpi-1.1.5.dist-info/RECORD +137 -0
- smartpi-1.1.4.dist-info/RECORD +0 -77
- {smartpi-1.1.4.dist-info → smartpi-1.1.5.dist-info}/WHEEL +0 -0
- {smartpi-1.1.4.dist-info → smartpi-1.1.5.dist-info}/top_level.txt +0 -0
smartpi/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
from ._gui import gui
|
|
2
|
+
from .base_driver import P1, P2, P3, P4, P5, P6, M1, M2, M3, M4, M5, M6
|
|
3
|
+
|
|
4
|
+
__all__ = ["base_driver","gui","audio","ultrasonic","touch_sensor","temperature","humidity","light_sensor","color_sensor","motor","servo","led","flash",
|
|
5
|
+
"trace","move","local_model","P1", "P2", "P3", "P4", "P5", "P6", "M1", "M2", "M3", "M4", "M5", "M6"]
|
|
6
|
+
|
|
7
|
+
__version__ = "1.1.5"
|
|
8
|
+
|
smartpi/__init__.pyc
CHANGED
|
Binary file
|
smartpi/_gui.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import socket
|
|
4
|
+
import json
|
|
5
|
+
import time
|
|
6
|
+
|
|
7
|
+
class gui_client:
|
|
8
|
+
def __init__(self, host="127.0.0.1", port=65167, timeout=2.0):
|
|
9
|
+
self.sock = None
|
|
10
|
+
try:
|
|
11
|
+
self.sock = socket.create_connection((host, port), timeout=timeout)
|
|
12
|
+
self.clear()
|
|
13
|
+
except :
|
|
14
|
+
self.sock = None
|
|
15
|
+
|
|
16
|
+
def is_connected(self):
|
|
17
|
+
result = False
|
|
18
|
+
if self.sock is not None:
|
|
19
|
+
result = True
|
|
20
|
+
return result
|
|
21
|
+
|
|
22
|
+
def _send(self, cmd):
|
|
23
|
+
if self.sock is None:
|
|
24
|
+
return
|
|
25
|
+
try:
|
|
26
|
+
self.sock.sendall((json.dumps(cmd) + "\n").encode())
|
|
27
|
+
time.sleep(0.1) # 确保命令发送出去
|
|
28
|
+
except :
|
|
29
|
+
self.sock = None
|
|
30
|
+
|
|
31
|
+
def show_text(self, x, y, text, color="black", size=16, update_bgc=False, bgc_color="white"):
|
|
32
|
+
self._send({"type": "text", "x": x, "y": y, "text": text, "color": color, "size": size, "update_bgc": update_bgc, "bgc_color": bgc_color})
|
|
33
|
+
|
|
34
|
+
def print(self, text):
|
|
35
|
+
self._send({"type": "print", "text": text})
|
|
36
|
+
|
|
37
|
+
def println(self, text):
|
|
38
|
+
self._send({"type": "println", "text": text})
|
|
39
|
+
|
|
40
|
+
def show_image(self, x, y, path, width, height):
|
|
41
|
+
self._send({"type": "image", "x": x, "y": y, "path": path, "width": width, "height": height})
|
|
42
|
+
|
|
43
|
+
def draw_line(self, x1, y1, x2, y2, color="black", width=1):
|
|
44
|
+
self._send({"type": "line", "x1": x1, "y1": y1, "x2": x2, "y2": y2, "color": color, "width": width})
|
|
45
|
+
|
|
46
|
+
def fill_rect(self, x, y, w, h, color="black"):
|
|
47
|
+
self._send({"type": "fill_rect", "x": x, "y": y, "w": w, "h": h, "color": color})
|
|
48
|
+
|
|
49
|
+
def draw_rect(self, x, y, w, h, width, color="black"):
|
|
50
|
+
self._send({"type": "draw_rect", "x": x, "y": y, "w": w, "h": h, "width": width, "color": color})
|
|
51
|
+
|
|
52
|
+
def fill_circle(self, cx, cy, r, color="black"):
|
|
53
|
+
self._send({"type": "fill_circle", "cx": cx, "cy": cy, "r": r, "color": color})
|
|
54
|
+
|
|
55
|
+
def draw_circle(self, cx, cy, r, width, color="black"):
|
|
56
|
+
self._send({"type": "draw_circle", "cx": cx, "cy": cy, "r": r, "width": width, "color": color})
|
|
57
|
+
|
|
58
|
+
def clear(self):
|
|
59
|
+
self._send({"type": "clear"})
|
|
60
|
+
|
|
61
|
+
def finish(self):
|
|
62
|
+
self.sock.close()
|
|
63
|
+
|
|
64
|
+
# 外部调用
|
|
65
|
+
gui = gui_client()
|
|
66
|
+
|
smartpi/_gui.pyc
CHANGED
|
Binary file
|