这是一个专门为儿童设计的AI玩具故事系统,让儿童直接使用故事角色的模型,放在AI PC上部的无线识别区域,让系统识别,系统根据提供的角色,调用本地LLM大模型来生成故事,并播放故事音频。
This is an AI toy story system specially designed for children. It allows children to directly use the model of the story character and place it in the wireless identification area on the upper part of the AI PC for the system to recognize. The system calls the local LLM large model to generate the story based on the provided character. , and play the story audio.
Please check out the demo video::https://player.bilibili.com/player.html?isOutside=true&aid=112885128890906&bvid=BV1P7vaeLEd2&cid=500001634463091&p=1
为什么 Why使用电子标签,可以很方便的改造和利用手头的玩具模型。
你可以使用动物的玩具模型,可以使用小车的玩具,或者任意其他你想作为故事角色的模型或者小型玩具。
同时,使用这种方式,让儿童可以很容易的进行操作,只需要将玩具角色放置到检测区域,通过无线检测即可,检测到了就会播放提示音。
这种操作模式,可以让较小的孩子,也能快速的学会使用。
另外,得益于基于with AMD Ryzen™ AI的PC AI ,可以在本地运行大模型,而无需考虑费用的消耗。
Using electronic tags, you can easily modify and utilize the toy models you have on hand.
You can use toy models of animals, you can use toy cars, or any other model or small toy that you want to serve as a character in the story.
At the same time, using this method, children can easily operate it. They only need to place the toy character in the detection area and detect it wirelessly. When detected, a prompt sound will be played.
This operating mode allows smaller children to quickly learn to use it.
In addition, thanks to PC AI based on AMD Ryzen™ AI, large models can be run locally without considering the cost.
AI玩具故事系统的硬件包括运行平台、故事角色、电子标签、电子标签读卡器和音箱。
AI玩具故事系统的硬件平台,使用了PC AI with AMD Ryzen™ AI,实际的硬件设备为UM790 PRO。
为了给故事角色赋予角色,我使用了NFC标签,将NFC标签放置于角色模型的底部即可。
为了让系统识别玩具角色,我配置了一个NFC读卡器,可以检测到NFC标签,并通过USB串口发送读取到的信息。我使用的读卡器的USB芯片为CP2102。
The hardware of the AI toy story system includes an operating platform, story characters, electronic tags, electronic tag readers and speakers.
The hardware platform of the AI Toy Story system uses PC AI with AMD Ryzen™ AI, and the actual hardware device is UM790 PRO.
To give the story characters a role, I used an NFC tag, which I placed at the bottom of the character model.
In order for the system to recognize the toy character, I configured an NFC card reader that can detect the NFC tag and send the read information through the USB serial port. The USB chip of the card reader I use is CP2102.
AI玩具故事系统使用Python编程语言进行开发,运行与Windows平台。
PC AI运行的操作系统为Windows11。在该系统上,我安装了Python3.10,用于运行AI玩具故事系统。
The AI toy story system is developed using the Python programming language and runs on the Windows platform.
The operating system PC AI runs on is Windows 11. On this system, I installed Python3.10 for running the AI toy story system.
- AI玩具故事系统启动
- 检查NFC串口设备
- 检查NFC串口设备
- 播放提示音,等待放置故事角色
- 将故事角色放置到AI PC上部的无线识别区域,系统检测到以后,将会播放角色的名称
- 角色放置完成后,使用启动卡放置到AI PC上部的无线识别区域,系统检测到以后,将会自动使用当前已放置的角色,调用本地LLM,来生成角色对应的故事,生成的过程中,会调用TTS服务生成对应的音频,并播放故事的内容。
- AI toy story system start
- Check NFC serial device
- Play the prompt sound and wait for the story character to be placed
- Place the character in the wireless identification area on the upper part of the AI PC. After the system detects it, the name of the character will be played.
- After the character placement is completed, use the startup card to place it in the wireless identification area on the upper part of the AI PC. After the system detects it, it will automatically use the currently placed character and call the local LLM to generate the story corresponding to the character. During the generation process, The TTS service will be called to generate the corresponding audio and play the content of the story.
为了在PC AI with AMD Ryzen™ AI上运行LLM,我经过了较长时间测摸索和测试,发现最终LM Studio能够提供较好的支持。
In order to run LLM on PC AI with AMD Ryzen™ AI, I spent a long time exploring and testing and found that LM Studio can finally provide better support.
首先,安装LM Studio,安装后,先下载需要的模型:
First, install LM Studio. After installation, download the required models:
实际下载的模型为:Qwen/Qwen2-7B-Instruct-GGUF
The actual downloaded model is: Qwen/Qwen2-7B-Instruct-GGUF
需要注意的是,要选择Q4-K-M,才能在PC AI with AMD Ryzen™ AI上运行。
It should be noted that you need to select Q4-K-M to run on PC AI with AMD Ryzen™ AI
然后启动本地openai兼容服务:
Then start the local openai compatible service:
要运行AI玩具故事系统,做好硬件上的准备后,可以按照如下的步骤进行运行。
To run the AI Toy Story system, after preparing the hardware, you can follow the steps below.
首先安装conda,然后创建对应的虚拟运行环境:
First install conda, and then create the corresponding virtual running environment:
conda create --name toy_story python=3.10
创建完成后,激活运行环境:
After creation, activate the running environment:
conda activate toy_story
再安装需要的支持库:
Then install the required support libraries:
pip instal pyserial
pip install requests
pip install openai
2. 配置id信息 Configure id information每个NFC标签都有一个ID信息,需要进行配置,以便关联不同的角色。
Each NFC tag has an ID information that needs to be configured to associate with different roles.
打开config.py,编辑如下信息:
Open config.py and edit the following information:
# toy characters define
toy_id_list = {
"2000000944001D93FB9C031080C803" : {
"en": "Tiger",
"zh": "老虎"
},
"2000000944001D660A9D031080CD03" : {
"en": "Elephant",
"zh": "大象"
},
"2000000944001D730C9D031080DE03" : {
"en": "Rabbit",
"zh": "rabbit"
},
# Add more
}
# start action card id
start_id = "20000008040000000788537B5403"
你还可以查看config.py中的其他配置,根据实际需要进行配置。
You can also view other configurations in config.py and configure them according to actual needs.
另外,你还需要从minimax获取账号信息,以便使用TTS服务。
In addition, you also need to obtain account information from minimax in order to use the TTS service.
配置完成后,直接运行即可:
After the configuration is complete, just run:
python ap.py
启动后,会首先检测读卡器串口是否正常。如果串口正常,则播放提示信息,提示放置角色。
After startup, it will first detect whether the serial port of the card reader is normal.
If the serial port is normal, a prompt message will be played to prompt you to place the character.
系统正常启动后,将故事角色,放置到读卡器的上部,进行识别。
After the system starts normally, place the story character on the upper part of the card reader for identification.
系统将会自动进行识别,并播放提示信息:
The system will automatically identify and play the prompt message:
如果需要多个故事角色,则可以放置多次不同的角色即可。
If you need multiple story characters, you can place different characters multiple times.
最后,放置启动卡,就可以开始故事的生成和播放了:
Comments