cpsiot 发表于 2024-11-6 19:49

【2024 DigiKey 创意大赛】基于AI的室内环境自适应调节系统(离线大模型)【作品提...

本帖最后由 cpsiot 于 2024-11-8 17:28 编辑

<div>
<p>&nbsp;</p>

<p style="text-align: center;"><strong><span style="font-size:24px;">基于AI的室内环境自适应调节系统</span></strong></p>

<p style="text-align: right;"><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;作者:eric &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></strong></p>

<p><span style="font-size:24px;"><strong>1.作品简介</strong></span></p>

<p><br />
<strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;广州连续三个多月的雨季,给人民生产生活带来及其不便,加上回南天的影响,造成居室多处发霉,衣服无法晾晒,改善居住环境,降低潮湿环境对人类健康的影响迫在眉睫。</span></strong></p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;本项目集成离线语音唤醒+离线语音识别+离线AI大模型+离线TTS文字转语音+自动化控制+天气预测,将树莓派5(2G)性能压榨到极致!</span></strong></p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;系统基于树莓派5控制器,接入温湿度,气压传感器,485继电器模块等,基于天气预测模型算法,对未来30分钟天气状况实时预测,配合模糊控制算法,对室内环境进行自动化调节,创造舒适居家环境。</span></strong></p>

<h2><strong><span style="font-size:20px;">项目背景:</span></strong></h2>

<ol start="12" style="list-style-type:lower-alpha">
        <li value="50"><strong><span style="font-size:20px;">南方雨季长达3个月以上,给人民生活带来极大的不便;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">回南天家中湿度可以超过90%以上,如不做预防和干预,家中电器等物品极易损坏和发霉;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">南方经常下雨,衣物晾干及其不易;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">人体长期生活在湿热环境中,极易引发风湿等疾病;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">室内空气流通差,容易滋生细菌。</span></strong></li>
</ol>

<h2><strong><span style="font-size:20px;">实现目标:</span></strong></h2>

<ol start="12" style="list-style-type:lower-alpha">
        <li value="50"><strong><span style="font-size:20px;">室内环境自动调节,无需人工干预;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以语音控制各个设备;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以预测未来30分钟天气;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以实现语音互动;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">无需网络也可工作;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可接入AI大模型;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">方便扩展多种传感器和执行设备。</span></strong></li>
</ol>

<p>&nbsp;</p>

<p>&nbsp;</p>

<h2><strong><span style="font-size:20px;">作品照片:</span></strong></h2>

<p><strong><span style="font-size:20px;">测试DEMO全家福</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">485继电器模块</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p><strong><span style="font-size:20px;">USB麦克风+喇叭</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">树莓派5+无风扇金属外壳</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p><strong><span style="font-size:20px;">IIC扩展转接板</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<h2><strong><span style="font-size:20px;">功能介绍:</span></strong></h2>

<ol start="12" style="list-style-type:lower-alpha">
        <li value="50"><strong><span style="font-size:20px;">室内环境自动调节,无需人工干预;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以语音控制各个设备;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以预测未来30分钟天气;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可以实现语音大模型AI互动;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">可接入不同AI大模型;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">方便扩展多种传感器和执行设备;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">系统无需联网,离线运行;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">纯离线运行,安全隐私保障;</span></strong></li>
        <li value="50"><strong><span style="font-size:20px;">永久免费,无后期调用语音识别AI等接口费用。</span></strong></li>
</ol>

<p>&nbsp;</p>

<h2><strong><span style="font-size:20px;">技术路线:</span></strong></h2>

<ul>
        <li><strong><span style="font-size:20px;">使用树莓派5开发板,接入温湿度气压传感器,配合天气预测模型算法,完成未来30分钟天气预测;</span></strong></li>
        <li><strong><span style="font-size:20px;">通过树莓派5连接USB485转换器,使用模糊控制算法,对接继电器模块,配合温湿度、气压传感器,完成风扇,加湿器,除湿机,暖风机等设备的自动化控制,实现无人值守自动化运行,将室内环境实时调节到最佳状态。</span></strong></li>
        <li><strong><span style="font-size:20px;">使用USB麦克风+喇叭模块,通过部署离线语音唤醒,完成树莓派的语音唤醒功能;</span></strong></li>
        <li><strong><span style="font-size:20px;">通过部署离线大模型,完成AI人机对话功能;</span></strong></li>
        <li><strong><span style="font-size:20px;">通过文字转语音TTS功能,完成AI输出转语音功能;</span></strong></li>
        <li><strong><span style="font-size:20px;">综合以上设备硬件及软件,完成系统的完整功能。</span></strong></li>
</ul>

<p>&nbsp;</p>

<p>&nbsp;</p>

<ul>
        <li><strong><span style="font-size:20px;">系统框图</span></strong></li>
</ul>

<h2><strong><span style="font-size:20px;">系统整体架构图:</span></strong></h2>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<h2><strong><span style="font-size:20px;">硬件原理框图:</span></strong></h2>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<h2><strong><span style="font-size:20px;">开发流程图:</span></strong></h2>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">三、各部分功能说明(图文结合)</span></strong></p>

<p><strong><span style="font-size:20px;">(各部分实现的功能说明及讲解,以图文结合的展示。)</span></strong></p>

<h2><strong><span style="font-size:20px;">电源:</span></strong></h2>

<p><strong><span style="font-size:20px;">电源采用树莓派5带PD的5V5A 27W国产替代电源;继电器供电采用24V电源;</span></strong></p>

<h2><strong><span style="font-size:20px;">控制器:</span></strong></h2>

<p><strong><span style="font-size:20px;">控制器使用树莓派5(2G)版本,建议使用8G内存版本;</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp; &nbsp;</span></strong></p>

<p><strong><span style="font-size:20px;">传感器使用SHT31+BMP180:</span></strong></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;"> &nbsp; &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">控制风扇,热风机,除湿机,加湿器采用485继电器模块:</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p><strong><span style="font-size:20px;">麦克风喇叭使用USB接口:</span></strong></p>

<p><strong><span style="font-size:20px;"> &nbsp;</span></strong></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><span style="font-size:24px;"><strong>四、作品源码</strong></span></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;"><a href="https://github.com/omaday/homeai"><u>https://github.com/omaday/homeai</u></a></span></strong></p>

<p>&nbsp;</p>

<p dir="auto"><strong><span style="font-family:Microsoft YaHei;">#############################################</span></strong></p>

<p dir="auto"><strong><span style="font-family:Microsoft YaHei;">运行语音大模型程序 python homeai.py </span></strong></p>

<p dir="auto"><strong><span style="font-family:Microsoft YaHei;">#############################################</span></strong></p>

<p dir="auto"><strong><span style="font-family:Microsoft YaHei;">运行自动控制程序 python fuzz.py</span></strong></p>

<p dir="auto"><strong><span style="font-family:Microsoft YaHei;">##############################################</span></strong></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">安装依赖库</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">修改swap分区配置(树莓派2G版本,其他版本可以忽略) sudo nano /etc/dphys-swapfile 想设置4GiB的swap分区,可以设置&ldquo;CONF_SWAPSIZE=4096 sudo /etc/init.d/dphys-swapfile restart free -h</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">配置USB声卡 aplay -l 找到设备号2(USB声卡) sudo nano /usr/share/alsa/alsa.conf 修改为2 defaults.ctl.card 2 defaults.pcm.card 2</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">sudo nano ~/.asoundrc pcm.!default { type hw card 2 }</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">ctl.!default { type hw card 2 }</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">使用图形界面,可以右键点击任务栏上的音量图标,选择&ldquo;音频输出设备&rdquo;,并选择USB音频设备。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">重启测试声卡</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">安装TTS pip install coqui-tts # from PyPI</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">error: can&#39;t find Rust compiler curl --proto &#39;=https&#39; --tlsv1.2 -sSf&nbsp;<a href="https://sh.rustup.rs/" rel="nofollow">https://sh.rustup.rs</a>&nbsp;| sh</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">pip install coqui-tts</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">测试(中文一定要加句号,不然会拖拉音) tts --text &quot;首次运行时的模型加载可能比较耗时。可以在初始化时预加载模型,以减少实际合成时的等待时间,尤其在需要连续使用的应用中效果明显。&quot;<br />
--model_name &quot;tts_models/zh-CN/baker/tacotron2-DDC-GST&quot;<br />
--out_path output.wav</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">最新版本的Snowboy软件下载到Raspberry Pi上,运行以下命令来解压它。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">请确认你位于Pi用户的主目录中。( /home/pi 或 ~)</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">snowboy编译出Makefile:73: recipe for target &lsquo;_snowboydetect.so&lsquo; failed</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">jack_control start</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">2.2 安装PyAudio,这个在requirements.txt里面要求了。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">PyAudio 提供了 PortAudio 的 Python 语言版本,所以上面要安装portaudio。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">sudo pip install pyaudio 2.3 安装其它依赖包</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">sudo apt-get install swig sox libpcre3 libpcre3-dev libatlas-base-dev 3 安装Python2版本</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">cd snowboy/swig/Python make 生成 _snowboydetect.so 就编译成功了 4 常见错误</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">&hellip;/&hellip;/lib/ubuntu64/libsnowboy-detect.a:error adding symbols: File in wrong format 此错误是Makefile中没有使用正确版本的libsnowboy-detect.a</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">在snowboy/lib下一共有</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">aarch64-ubuntu1604/ --对应arm64 ubuntu1604,经验证ubuntu1804也可以使用 android/ --对应android系统 ios/ --对应ios系统 node/ osx/ --对应macos rpi/ --对应树莓派32位arm ubuntu64/ --对应PC Ubuntu64</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">其它系统,查询电脑类型就可以知道用上面哪个了</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">uname -m 因此按下面修改Makefile就可以解决这个问题了</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">SNOWBOYDETECTLIBFILE =&nbsp;(TOPDIR)/lib/ubuntu64/libsnowboy&minus;detect.aifneq(,(findstring arm,$(shell uname -m))) SNOWBOYDETECTLIBFILE = $(TOPDIR)/lib/rpi/libsnowboy-detect.a ifeq ($(findstring fc,$(shell uname -r)), fc) #fedora25-armv7这个没看到 SNOWBOYDETECTLIBFILE = $(TOPDIR)/lib/fedora25-armv7/libsnowboy-detect.a LDLIBS := -L/usr/lib/atlas -lm -ldl -lsatlas endif endif</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">#以下修改内容请根据系统选择,这里环境为ubuntu1804 ifneq (,$(findstring aarch64,$(shell uname -m))) SNOWBOYDETECTLIBFILE = $(TOPDIR)/lib/aarch64-ubuntu1604/libsnowboy-detect.a endif</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">或者前面全部注释,用下面这句 SNOWBOYDETECTLIBFILE = $(TOPDIR)/lib/aarch64-ubuntu1604/libsnowboy-detect.a 5 测试</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">cd snowboy/examples/Python python demo.py ../resources/models/snowboy.umdl 对着话筒说snowboy,如果出现以下提示,并听到叮的一声,就表示成功了。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">INFO:snowboy:Keyword 1 detected at time: 2020-09-18 11:47:32 测试如果出现--问题1</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started 请安装jackd2</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">apt-get install -y jackd2</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">#pulseaudio --kill关闭 --start启动 jack_control start #启动 status查看状态 exit退出 安装jackd2后重启一下,否则可能出现--问题2</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">Cannot lock down 82274202 byte memory area (Cannot allocate memory) python3版本可能出现问题3</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">from . import snowboydetect ImportError: attempted relative import with no known parent package 在目录example/Python3中添加空的__init__.py,另外在snowboydecoder.py</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">#!/usr/bin/env python 改为 #!/usr/bin/env python3</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">from . import snowboydetect 改为 import snowboydetect 问题3</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">出现了IOError: Invalid output device (no default output device)</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">原因是系统没有音频输出设备(喇叭、音箱)或者没有配置好。因为检测到唤醒词后会播放Ding.wav的声音。另外给两个关键词almixer和aplay。</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">安装Whisper(语音识别) pip install -U openai-whisper</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">升级 pip install --upgrade --no-deps --force-reinstall git+<a href="https://github.com/openai/whisper.git">https://github.com/openai/whisper.git</a></span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">安装必备库 sudo apt update &amp;&amp; sudo apt install ffmpeg</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">whisper test.wav --model tiny --language zh</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">import whisper</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">model = whisper.load_model(&quot;tiny&quot;) result = model.transcribe(&quot;test.mp3&quot;, fp16=False) print(result[&quot;text&quot;])</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">简体繁体不区分问题: prompt=&#39;以下是普通话的句子&#39; result = model.transcribe(audioFile, task=&#39;translate&#39;,language=&#39;zh&#39;,verbose=True,initial_prompt=prompt)</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">pip install opencc</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">import opencc cc = opencc.OpenCC(&ldquo;t2s&rdquo;) simplified_result = cc.convert(&#39;漢字&#39;)<br />
print(&ldquo;简体格式:&rdquo;, simplified_result) #输出结果为 简体格式:汉字</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">安装本地大模型,推荐qwen0.5b</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">然后安装 pip3 install ollama 测试不要用ollama.py命名</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">天气预测依赖库 pip install pandas scikit-learn statsmodels</span></strong></span></p>

<p dir="auto"><span style="font-size:16px;"><strong><span style="font-family:Microsoft YaHei;">自动化模糊控制依赖库 import numpy as np import skfuzzy as fuzz from skfuzzy import control as ctrl</span></strong></span></p>

<p>&nbsp;</p>

<p><span style="font-size:24px;"><strong>五、作品功能演示视频</strong></span></p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;视频记录了系统完整的使用过程,感谢大家支持!</span></strong><span style="font-size:24px;"><strong>&nbsp;&nbsp;<a href="https://www.bilibili.com/video/BV1owD5YvEGF/?spm_id_from=333.999.0.0&amp;vd_source=2c0233b89c0a928d16c1219e7c855cae" target="_blank">演示视频</a></strong></span></p>

<p>&nbsp;</p>

<p><span style="font-size:24px;"><strong>六、项目总结</strong></span></p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;原本打算使用国产工业互联网平台进行无代码开发,由于平台近期维护升级,无奈选用B方案,使用PYTHON进行编程,部署环境花费了1周时间,库模块之间的依赖相互冲突,导致树莓派系统重做了好几次,几经周折才将所有的库模块安装测试完成,又花费了一周时间调试测试,最终累计花费2周时间完成,将树莓派5(2G)性能压榨到极致!集成离线语音唤醒+离线语音识别+离线AI大模型+离线TTS文字转语音+自动化控制+天气预测,CPU负荷4核100%!内存使用超100%!</span></strong></p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;作为一个原型项目基本上实现了预定的目标,通过简单的DEMO测试,系统暂时运行良好。由于时间关系,只完成了核心功能。后期有时间会加入更多传感器和执行器、针对智能家居做一个完整案例。</span></strong></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;帖子分享链接汇总:</span></strong></p>

<p><strong><span style="font-size:20px;"><a href="https://bbs.eeworld.com.cn/thread-1294865-1-1.html"><u>&nbsp;&nbsp;&nbsp;&nbsp;https://bbs.eeworld.com.cn/thread-1294865-1-1.html</u></a></span></strong></p>

<p><strong><span style="font-size:20px;"><u><a href="https://bbs.eeworld.com.cn/thread-1295485-1-1.html" target="_blank">&nbsp;&nbsp;&nbsp;&nbsp;https://bbs.eeworld.com.cn/thread-1295485-1-1.html</a></u></span></strong></p>

<p>&nbsp;</p>

<p><strong><span style="font-size:20px;">七、其他</span></strong></p>

<p><br />
<strong><span style="font-size:20px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;感谢得捷电子和EEWORLD举办这次物联网大赛,同时提供了研发资助。感谢大家对本项目的关注。祝愿这次比赛圆满成功。祝各位参赛选手都能取得优异的成绩!</span></strong></p>

<p>&nbsp;</p>

<div><strong></strong></div>

<p>&nbsp;</p>

<p>&nbsp;</p>
</div>

<p><!--importdoc--></p>
页: [1]
查看完整版本: 【2024 DigiKey 创意大赛】基于AI的室内环境自适应调节系统(离线大模型)【作品提...