From 0770774f0280895ebbdd6d1643405894aec7e4d3 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Wed, 26 Apr 2023 13:44:28 +0800 Subject: [PATCH 01/10] Add files via upload --- ...0\347\224\250\344\273\243\347\240\201.txt" | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 "\345\270\270\347\224\250\344\273\243\347\240\201.txt" diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" new file mode 100644 index 0000000..f057a15 --- /dev/null +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -0,0 +1,162 @@ +去重 +df = df.drop_duplicates().reset_index(drop=True) +删除某一列 +df2=df2.drop(cols,axis=1) +删除两行 +df.drop(index=[0, 1]) + +date转字符串 + +from datetime import datetime, date, time +d = date.fromisoformat('2018-09-22') +t = time.fromisoformat('16:28:22') +dt = datetime.fromisoformat('2018-09-22') + +sdate = pd.to_datetime(ds).strftime('%Y-%m-%d') +st = "2019-01-20 00:00:00" +dt = datetime.datetime.strptime(st, '%Y-%m-%d %H:%M:%S') +st = "2019-01-20" +dt = datetime.datetime.strptime(st, '%Y-%m-%d') +start=pd.to_datetime('2017-01-01') + + + +修改类型 +train['tf_status'] = t1['tf_status'].astype(np.int64) + +修改日期类型 +df['ds'] = pd.to_datetime(df['ds']) + +修改字段名 +df.rename(columns={'#studentid':'studentid'}, inplace = True) + +#加年月 +df['year']=df.datetime.apply(lambda x: x.year) +df['month'] = df.datetime.apply(lambda x: x.month) +df['year'] = df['year'].astype(np.int64) +df['month'] = df['month'].astype(np.int64) + +删除字段 +df.drop(['#id'], axis=1, inplace=True) + +查看数据中顶部10%的数据 +print(df.weeks.quantile(np.arange(.9,1,.01))) + +设置索引 +df = df.set_index(['hetongdetailid']) + +判断空值 + +print("在 cat 列中总共有 %d 个空值." % df['cat'].isnull().sum()) + +print("在 review 列中总共有 %d 个空值." % df['review'].isnull().sum()) + +df[df.isnull().values==True] + +df = df[pd.notnull(df['review'])] + +排序 +df.sort_values(by="x1",ascending= False) + +模糊查询 +df_remark_tf[df_remark_tf["content_method"].str.contains(keystring)] + +修改字段类型 +df_appraise['deptid'] = df_appraise['deptid'].astype(np.int64) + +修改数据(https://blog.csdn.net/zhangchuang601/article/details/79583551) +df.loc[1,['name','age']] = ['bb',11] +df.iloc[1,2] = 19#修改某一无 +df.loc[df[df.htid.isin(ids)].index,"y"]=1 + +保存数据库 +df.to_sql(name='predict',con=mysql_engine,if_exists = 'replace') + +生成日期 +dt = datetime.datetime(year, month, 1) + +查看顶部10%数据分布 +print(movie_rating_count['totalRatingCount'].quantile(np.arange(.9,1,.01))) + +#-------plotly.express------------------------- +#折线图 +import plotly.express as px + +fig = px.line(df, x='date', y='y_true', + labels={'date':'日期', 'y_true':'话务量'}, + markers=True) +fig.update_xaxes(tickformat = "%Y-%m-%d", hoverformat = "%Y-%m-%d") +fig.update_layout(title_text="热线部门日业务量趋势图", title_x=0.5) +fig.update_traces(marker=dict(size=3)) #控制点的大小 +fig.show() + +#散点图 +fig = px.scatter(df, x="真实订单量", y="真实金额",hover_data=['did','日期']) +fig.update_traces(marker=dict(size=4)) #点的大小 +fig.show() + +---------------------------------- +1、nohup command & +例如 nohup jupyter notebook & + +2、找到进程PID(关闭在前面后台执行的进程的步骤,首先找到其进程PID) +ps -ef | grep xxxx +ps -ef 查看本机所有的进程;grep xxxx代表过滤找到条件xxxx的项目 + +3、kill掉进程 +kill -9 具体的PID + +-------------打开指定端口------------------------------------- +firewall-cmd --zone=public --add-port=8504/tcp --permanent +firewall-cmd --reload + +netstat -ntlp //查看当前所有tcp端口· +netstat -ntulp |grep 8888 //查看所有1935端口使用情况 + +------------------更新pip命令---------------------------------------- +python -m pip install --upgrade pip + +-------------搭建虚拟环境----------------------------- +# 创建虚拟环境 +conda create --name yourenvname python=3.8 + +# 进入虚拟环境 +conda activate yourenvname + +#退出虚拟环境 +conda deactivate + +#删除虚拟环境 +conda remove -n py39 --all + +# 在jupyter notebook中添加虚拟环境 +python -m ipykernel install --user --name yourenvname --display-name "display-name" + + +------------------在jupyter notebook里面添加虚拟环境---------------------------------------- +1.cmd进入虚拟环境(torch_env) +activate torch_env + +2.pip install ipykernel ipython +回车 + +3.ipython kernel install --user --name torch_env +回车 + +4.再次进入jupyter notebook +右上角,new,即可选择需要的虚拟环境。 + +5.另外,如果需要在指定文件夹中打开jupyter notebook,只需要打开文件夹所在位置,点击搜索框左边的位置框,输入cmd,再输入jupyter notebook,即可将路径设为自己需要的。 + +在jupyter 中删除虚拟环境 +6.jupyter kernelspec uninstall myenv + +---------pip install 镜像安装----------------------------------------- +pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple + + + + + + + From a112a508a6a32866779653f4e2b1f25716a883f5 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:45:27 +0800 Subject: [PATCH 02/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\347\224\250\344\273\243\347\240\201.txt" | 144 +++++++++++------- 1 file changed, 87 insertions(+), 57 deletions(-) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index f057a15..8396fca 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -1,11 +1,11 @@ -去重 +鍘婚噸 df = df.drop_duplicates().reset_index(drop=True) -删除某一列 +鍒犻櫎鏌愪竴鍒 df2=df2.drop(cols,axis=1) -删除两行 +鍒犻櫎涓よ df.drop(index=[0, 1]) -date转字符串 +date杞瓧绗︿覆 from datetime import datetime, date, time d = date.fromisoformat('2018-09-22') @@ -21,139 +21,169 @@ start=pd.to_datetime('2017-01-01') -修改类型 +淇敼绫诲瀷 train['tf_status'] = t1['tf_status'].astype(np.int64) -修改日期类型 +淇敼鏃ユ湡绫诲瀷 df['ds'] = pd.to_datetime(df['ds']) -修改字段名 +淇敼瀛楁鍚 df.rename(columns={'#studentid':'studentid'}, inplace = True) -#加年月 +#鍔犲勾鏈 df['year']=df.datetime.apply(lambda x: x.year) df['month'] = df.datetime.apply(lambda x: x.month) df['year'] = df['year'].astype(np.int64) df['month'] = df['month'].astype(np.int64) -删除字段 +鍒犻櫎瀛楁 df.drop(['#id'], axis=1, inplace=True) -查看数据中顶部10%的数据 +鏌ョ湅鏁版嵁涓《閮10%鐨勬暟鎹 print(df.weeks.quantile(np.arange(.9,1,.01))) -设置索引 +璁剧疆绱㈠紩 df = df.set_index(['hetongdetailid']) -判断空值 - -print("在 cat 列中总共有 %d 个空值." % df['cat'].isnull().sum()) - -print("在 review 列中总共有 %d 个空值." % df['review'].isnull().sum()) +鍒ゆ柇绌哄 + +print("鍦 cat 鍒椾腑鎬诲叡鏈 %d 涓┖鍊." % df['cat'].isnull().sum()) + +print("鍦 review 鍒椾腑鎬诲叡鏈 %d 涓┖鍊." % df['review'].isnull().sum()) df[df.isnull().values==True] - + df = df[pd.notnull(df['review'])] -排序 +鎺掑簭 df.sort_values(by="x1",ascending= False) -模糊查询 +妯$硦鏌ヨ df_remark_tf[df_remark_tf["content_method"].str.contains(keystring)] -修改字段类型 +淇敼瀛楁绫诲瀷 df_appraise['deptid'] = df_appraise['deptid'].astype(np.int64) -修改数据(https://blog.csdn.net/zhangchuang601/article/details/79583551) +淇敼鏁版嵁(https://blog.csdn.net/zhangchuang601/article/details/79583551) df.loc[1,['name','age']] = ['bb',11] -df.iloc[1,2] = 19#修改某一无 +df.iloc[1,2] = 19#淇敼鏌愪竴鏃 df.loc[df[df.htid.isin(ids)].index,"y"]=1 -保存数据库 +淇濆瓨鏁版嵁搴 df.to_sql(name='predict',con=mysql_engine,if_exists = 'replace') -生成日期 +鐢熸垚鏃ユ湡 dt = datetime.datetime(year, month, 1) -查看顶部10%数据分布 +鏌ョ湅椤堕儴10%鏁版嵁鍒嗗竷 print(movie_rating_count['totalRatingCount'].quantile(np.arange(.9,1,.01))) #-------plotly.express------------------------- -#折线图 +#鎶樼嚎鍥 import plotly.express as px fig = px.line(df, x='date', y='y_true', - labels={'date':'日期', 'y_true':'话务量'}, + labels={'date':'鏃ユ湡', 'y_true':'璇濆姟閲'}, markers=True) fig.update_xaxes(tickformat = "%Y-%m-%d", hoverformat = "%Y-%m-%d") -fig.update_layout(title_text="热线部门日业务量趋势图", title_x=0.5) -fig.update_traces(marker=dict(size=3)) #控制点的大小 +fig.update_layout(title_text="鐑嚎閮ㄩ棬鏃ヤ笟鍔¢噺瓒嬪娍鍥", title_x=0.5) +fig.update_traces(marker=dict(size=3)) #鎺у埗鐐圭殑澶у皬 fig.show() -#散点图 -fig = px.scatter(df, x="真实订单量", y="真实金额",hover_data=['did','日期']) -fig.update_traces(marker=dict(size=4)) #点的大小 +#鏁g偣鍥 +fig = px.scatter(df, x="鐪熷疄璁㈠崟閲", y="鐪熷疄閲戦",hover_data=['did','鏃ユ湡']) +fig.update_traces(marker=dict(size=4)) #鐐圭殑澶у皬 fig.show() ---------------------------------- -1、nohup command & -例如 nohup jupyter notebook & +1銆乶ohup command & +渚嬪 nohup jupyter notebook & -2、找到进程PID(关闭在前面后台执行的进程的步骤,首先找到其进程PID) +2銆佹壘鍒拌繘绋婸ID(鍏抽棴鍦ㄥ墠闈㈠悗鍙版墽琛岀殑杩涚▼鐨勬楠わ紝棣栧厛鎵惧埌鍏惰繘绋婸ID) ps -ef | grep xxxx -ps -ef 查看本机所有的进程;grep xxxx代表过滤找到条件xxxx的项目 +ps -ef 鏌ョ湅鏈満鎵鏈夌殑杩涚▼锛沢rep xxxx浠h〃杩囨护鎵惧埌鏉′欢xxxx鐨勯」鐩 -3、kill掉进程 -kill -9 具体的PID +3銆乲ill鎺夎繘绋 +kill -9 鍏蜂綋鐨凱ID --------------打开指定端口------------------------------------- +-------------鎵撳紑鎸囧畾绔彛------------------------------------- firewall-cmd --zone=public --add-port=8504/tcp --permanent firewall-cmd --reload -netstat -ntlp //查看当前所有tcp端口· -netstat -ntulp |grep 8888 //查看所有1935端口使用情况 +netstat -ntlp //鏌ョ湅褰撳墠鎵鏈塼cp绔彛路 +netstat -ntulp |grep 8888 //鏌ョ湅鎵鏈1935绔彛浣跨敤鎯呭喌 -------------------更新pip命令---------------------------------------- +------------------鏇存柊pip鍛戒护---------------------------------------- python -m pip install --upgrade pip --------------搭建虚拟环境----------------------------- -# 创建虚拟环境 +-------------鎼缓铏氭嫙鐜----------------------------- +# 鍒涘缓铏氭嫙鐜 conda create --name yourenvname python=3.8 -# 进入虚拟环境 +# 杩涘叆铏氭嫙鐜 conda activate yourenvname -#退出虚拟环境 +#閫鍑鸿櫄鎷熺幆澧 conda deactivate -#删除虚拟环境 +#鍒犻櫎铏氭嫙鐜 conda remove -n py39 --all -# 在jupyter notebook中添加虚拟环境 +# 鍦╦upyter notebook涓坊鍔犺櫄鎷熺幆澧 python -m ipykernel install --user --name yourenvname --display-name "display-name" -------------------在jupyter notebook里面添加虚拟环境---------------------------------------- -1.cmd进入虚拟环境(torch_env) +------------------鍦╦upyter notebook閲岄潰娣诲姞铏氭嫙鐜---------------------------------------- +1.cmd杩涘叆铏氭嫙鐜锛坱orch_env锛 activate torch_env 2.pip install ipykernel ipython -回车 +鍥炶溅 3.ipython kernel install --user --name torch_env -回车 +鍥炶溅 -4.再次进入jupyter notebook -右上角,new,即可选择需要的虚拟环境。 +4.鍐嶆杩涘叆jupyter notebook +鍙充笂瑙掞紝new锛屽嵆鍙夋嫨闇瑕佺殑铏氭嫙鐜銆 -5.另外,如果需要在指定文件夹中打开jupyter notebook,只需要打开文件夹所在位置,点击搜索框左边的位置框,输入cmd,再输入jupyter notebook,即可将路径设为自己需要的。 +5.鍙﹀锛屽鏋滈渶瑕佸湪鎸囧畾鏂囦欢澶逛腑鎵撳紑jupyter notebook,鍙渶瑕佹墦寮鏂囦欢澶规墍鍦ㄤ綅缃紝鐐瑰嚮鎼滅储妗嗗乏杈圭殑浣嶇疆妗嗭紝杈撳叆cmd,鍐嶈緭鍏upyter notebook,鍗冲彲灏嗚矾寰勮涓鸿嚜宸遍渶瑕佺殑銆 -在jupyter 中删除虚拟环境 +鍦╦upyter 涓垹闄よ櫄鎷熺幆澧 6.jupyter kernelspec uninstall myenv ----------pip install 镜像安装----------------------------------------- +---------pip install 闀滃儚瀹夎----------------------------------------- pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple +#base64杞琍IL +def base64_to_pil(img_base64): + base64_decoded = base64.b64decode(img_base64) + byte_stream = io.BytesIO(base64_decoded) + pil_image = Image.open(byte_stream) + return pil_image +--------------------鍥句釜鏍煎紡杞崲--------------------------------------------------- +#PIL杞琤ase64 +def image_to_base64_str(pil_image): + byte_arr = io.BytesIO() + pil_image.save(byte_arr, format='PNG') + byte_arr = byte_arr.getvalue() + return str(base64.b64encode(byte_arr).decode('utf-8')) + +#鏁扮粍杞琤ase64(鏂规硶涓) +pil_image = Image.fromarray(cv2.cvtColor(image_array, cv2.COLOR_BGR2RGB)) +image_base64 = image_to_base64_str(pil_image) + +#鏁扮粍杞琤ase64(鏂规硶浜) +retval, buffer = cv2.imencode('.png', img_mask_face_array) +image_mask_face_base64 = base64.b64encode(buffer).decode('utf-8') + +# 灏哖IL杞崲涓篘umPy鏁扮粍 +array_image = np.array(pil_image) +array_image = np.asarray(pil_image) + +#array to pil +from PIL import Image +pil_image = Image.fromarray(image_array) + From a2348a1fef0ff9af2dc6c69aaeca748e6721fb94 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Mon, 9 Oct 2023 11:46:26 +0800 Subject: [PATCH 03/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\270\270\347\224\250\344\273\243\347\240\201.txt" | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index 8396fca..8bc50cd 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -154,13 +154,15 @@ activate torch_env ---------pip install 闀滃儚瀹夎----------------------------------------- pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple +--------------------鍥句釜鏍煎紡杞崲--------------------------------------------------- + #base64杞琍IL def base64_to_pil(img_base64): base64_decoded = base64.b64decode(img_base64) byte_stream = io.BytesIO(base64_decoded) pil_image = Image.open(byte_stream) return pil_image ---------------------鍥句釜鏍煎紡杞崲--------------------------------------------------- + #PIL杞琤ase64 def image_to_base64_str(pil_image): byte_arr = io.BytesIO() From 17f3961afa8ccb1cc21abc9ee459df9bab3f5f4e Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Tue, 21 May 2024 10:41:03 +0800 Subject: [PATCH 04/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\270\270\347\224\250\344\273\243\347\240\201.txt" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index 8bc50cd..58b2103 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -155,6 +155,7 @@ activate torch_env pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple --------------------鍥句釜鏍煎紡杞崲--------------------------------------------------- +from PIL import Image #base64杞琍IL def base64_to_pil(img_base64): From af6ed5455eb532c51d51d129a1bf0a9f4cfc40e7 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Fri, 17 Oct 2025 14:42:28 +0800 Subject: [PATCH 05/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt=20with=20new=20code=20snippets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\347\224\250\344\273\243\347\240\201.txt" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index 58b2103..a59954d 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -188,6 +188,24 @@ from PIL import Image pil_image = Image.fromarray(image_array) +闊抽噺璋冭妭 +alsamixer + +甯哥敤寮鏈鸿嚜鍚鐞嗗懡浠ゆ荤粨 +鎷疯礉.service鏂囦欢: sudo cp mcp_pipe.service /etc/systemd/system/mcp_pipe.service +璧嬫潈闄:sudo chmod 644 /etc/systemd/system/mcp_pipe.service +閲嶆柊鍔犺浇 systemd 閰嶇疆:sudo systemctl daemon-reload + +鍚敤寮鏈鸿嚜鍚: sudo systemctl enable mcp_pipe.service +绂佹寮鏈鸿嚜鍚: sudo systemctl disable mcp_pipe.service +绔嬪嵆鍚姩: sudo systemctl start mcp_pipe.service +绔嬪嵆鍋滄: sudo systemctl stop mcp_pipe.service +閲嶅惎鏈嶅姟: sudo systemctl restart mcp_pipe.service +鏌ョ湅鐘舵: sudo systemctl status mcp_pipe.service +鏌ョ湅瀹炴椂鏃ュ織锛歫ournalctl -u mcp_pipe.service -f + + + From 3f2fd81227ab672e895683f56b53f5200c10814c Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:06:51 +0800 Subject: [PATCH 06/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...270\347\224\250\344\273\243\347\240\201.txt" | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index a59954d..71fae59 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -204,6 +204,23 @@ alsamixer 鏌ョ湅鐘舵: sudo systemctl status mcp_pipe.service 鏌ョ湅瀹炴椂鏃ュ織锛歫ournalctl -u mcp_pipe.service -f +绗竴姝ワ細鍦 GitLab 涓婂垱寤轰竴涓柊鐨勭┖椤圭洰 +鍦ㄦ偍鐨勬祻瑙堝櫒涓墦寮 GitLab锛屽苟瀵艰埅鍒 xiaozhi 缁勩 +鐐瑰嚮椤甸潰鍙充笂瑙掔殑钃濊壊鎸夐挳 "New project"銆 +閫夋嫨 "Create blank project"銆 +鍦 "Project name" 瀛楁涓紝涓烘偍鐨勯」鐩懡鍚嶏紝渚嬪 simple-py-xiaozhi銆 +纭繚 "Project slug" 鍜 "Project URL" 鏄纭殑銆 +鎮ㄥ彲浠ラ夋嫨灏 "Visibility Level" 璁剧疆涓 "Private" 鎴 "Internal"銆 +涓嶈 鍕鹃 "Initialize repository with a README"銆傚洜涓烘偍鏈湴宸茬粡鏈夐」鐩簡锛屾墍浠ヨ鍒涘缓涓涓┖鐨勯」鐩 +鐐瑰嚮 "Create project"銆 + +1. cd D:\work\py-xiaozhi\simple-py-xiaozhi +2. git init +3. git remote add origin [鎮ㄥ湪GitLab涓婂垱寤虹殑椤圭洰鐨刄RL] +4. git add . +5. git commit -m "Initial commit" +6. git push -u origin main + From 5b6f9a012fcf0f90904a0b4bfca17921627cd7e3 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Thu, 23 Oct 2025 08:27:00 +0800 Subject: [PATCH 07/10] =?UTF-8?q?Update=20=E5=B8=B8=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...70\270\347\224\250\344\273\243\347\240\201.txt" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" index 71fae59..4c692d2 100644 --- "a/\345\270\270\347\224\250\344\273\243\347\240\201.txt" +++ "b/\345\270\270\347\224\250\344\273\243\347\240\201.txt" @@ -221,6 +221,20 @@ alsamixer 5. git commit -m "Initial commit" 6. git push -u origin main +---------esp32缂栬瘧---------------------- +cd ~/work/esp-idf +source ./export.sh + +1. idf.py set-target esp32s3 +2. idf.py menuconfig +3. idf.py build +------鐢熸垚鍗曚釜鍥轰欢鏂囦欢----- +4. cd build , +5. python3 -m esptool --chip esp32s3 merge_bin -o ../xiaozhi_ok.bin @flash_args +6. 鐑у綍鍥轰欢: +python -m esptool --chip esp32s3 -p /dev/tty.usbmodemXXXX -b 460800 --before default_reset --after hard_reset write_flash -z 0x0 xiaozhi.bin + + From 916d7ca0823349be3de30f450fd682c52d32c60e Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Thu, 21 May 2026 22:23:16 +0800 Subject: [PATCH 08/10] Add files via upload --- alignment_guide.md | 111 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 alignment_guide.md diff --git a/alignment_guide.md b/alignment_guide.md new file mode 100644 index 0000000..b0d3cb5 --- /dev/null +++ b/alignment_guide.md @@ -0,0 +1,111 @@ +# 馃洜锔 FastUMI 鏁版嵁閲囬泦锛歍265 鍧愭爣绯诲榻愪笌澶嶄綅鎸囧崡 + +鍦ㄤ娇鐢ㄥ熀浜 Intel RealSense T265 鐨勬墜鎸佽澶囷紙濡 FastUMI锛夎繘琛屾満鍣ㄤ汉鎿嶄綔鏁版嵁閲囬泦鏃讹紝**鈥滃榻愨濓紙Alignment锛夋垨鈥滃浣嶁濓紙Reset锛夋槸鏈鍏抽敭鐨勪竴姝**銆 + +鏈寚鍗楀皢閫氳繃鍥炬枃涓烘偍璇︾粏璇存槑涓轰粈涔堥渶瑕佸榻愶紝浠ュ強濡備綍姝g‘鍦拌繘琛岀墿鐞嗘搷浣溿 + +--- + +## 1. 涓轰粈涔堣杩涜鈥滃榻愨濓紵 + +T265 杩借釜鐩告満锛堣瑙夐噷绋嬭锛夋病鏈夊唴寤虹殑缁濆鍧愭爣鎰熴傚綋浣犲惎鍔ㄥ綍鍒剁▼搴忕殑鐬棿锛孴265 浼氭鏂湴瀹e竷锛 +**鈥滄垜鐜板湪鎵鍦ㄧ殑杩欎釜鐐瑰氨鏄畤瀹欑殑涓績 (0,0,0)锛屾垜鐜板湪鐨勬湞鍚戝氨鏄鍓嶆柟锛佲** + +### 鉂 濡傛灉涓嶅榻愶紙閿欒绀鸿寖锛 + +濡傛灉浣犻殢渚挎壘涓湴鏂规寜涓嬩簡鈥滃紑濮嬪綍鍒垛濓紝閭d箞姣忔鐢熸垚鐨勮建杩规暟鎹兘浼氳惤鍦ㄤ笉鍚岀殑鍧愭爣绯讳腑銆傛満鍣ㄤ汉瀛︿範绠楁硶鐪嬪埌鐨勬暟鎹氨鍍忎笅闈㈣繖鏍锋贩涔憋細 + +```mermaid +graph TD + subgraph 鐪熷疄涓栫晫 (浣犳兂鎶撶殑鏉瓙閮藉湪妗屽瓙涓ぎ) + Cup1((鏉瓙)) + Cup2((鏉瓙)) + end + + subgraph T265鐪间腑鐨勪笘鐣 (鏁版嵁閿欎贡) + A[褰曞埗1: 绂绘澂瀛愯繙鐐瑰惎鍔╙ --> |鏁版嵁璁板綍| X1((鏉瓙鍧愭爣: x=10)) + B[褰曞埗2: 绂绘澂瀛愯繎鐐瑰惎鍔╙ --> |鏁版嵁璁板綍| X2((鏉瓙鍧愭爣: x=2)) + end + + style Cup1 fill:#f9f,stroke:#333,stroke-width:2px + style X1 fill:#ff9,stroke:#333,stroke-width:2px +``` + +### 鉁 姝g‘鐨勫榻愶紙閿氱偣鏁堝簲锛 + +閫氳繃鍦ㄦ瘡娆$偣鍑烩滃紑濮嬪綍鍒垛濅箣鍓嶏紝灏嗘墜鎸佽澶囨斁缃湪**鍚屼竴涓墿鐞嗛敋鐐**锛屾垜浠氨寮鸿鎶 T265 鐨勨滈殢鏈哄潗鏍囩郴鈥濆拰鈥滄満鍣ㄤ汉鐨勭粷瀵瑰潗鏍囩郴鈥濈粦瀹氬湪浜嗕竴璧枫 + +```mermaid +flowchart LR + A[鐗╃悊閿氱偣\n(渚嬪锛氭瑙)] -->|姣忔閮藉湪姝ゅ惎鍔▅ B(T265: 杩欓噷鏄 0,0,0) + B -->|config.json 杞崲| C{鏈哄櫒浜哄熀搴:\n 閿氱偣浣嶄簬 x=0.5, z=0.3} + C -->|杈撳嚭鏈缁堟暟鎹畖 D[鎵鏈夊姩浣滆建杩圭簿鍑嗗榻怾 + + style A fill:#bbf,stroke:#333,stroke-width:2px + style D fill:#bfb,stroke:#333,stroke-width:2px +``` + +--- + +## 2. 涓夌瀹炵敤鐨勭墿鐞嗗榻愭柟妗 + +涓轰簡纭繚姣忔鍚姩鏃剁殑浣嶇疆鍜岃搴﹀畬鍏ㄤ竴鑷达紝浠ヤ笅鏄疄楠屽涓渶甯哥敤鐨勪笁绉嶆柟妗堬紙鎸夌簿搴︿粠浣庡埌楂樻帓鍒楋級锛 + +### 鏂规涓锛氭闈㈡爣璁版硶锛堝崄瀛楄兌甯︼級 +**绮惧害锛氣瓙 | 鎴愭湰锛氭瀬浣** + +杩欐槸鏈绠鍗曠殑鏂规锛岄傜敤浜庡缁濆绮惧害瑕佹眰涓嶆瀬绔殑浠诲姟銆 + +1. **鍑嗗**锛氬湪鎿嶄綔鍙伴潰涓婏紝鐢ㄦ湁鑹茶兌甯﹁创涓涓槑鏄剧殑鈥滃崄鈥濆瓧浣滀负瀵归綈鐐广 +2. **鏍囧畾**锛氭祴閲忚繖涓滃崄鈥濆瓧涓績鍒版満鍣ㄤ汉鐪熷疄搴曞骇鐨勭墿鐞嗚窛绂伙紙X, Y, Z锛夛紝灏嗘暟鍊煎~鍏 `config.json` 鐨 `base_position`銆 +3. **鎿嶄綔**锛 + - 姣忔褰曞埗鍓嶏紝灏嗘墜鎸佸す鐖殑灏栫锛圱CP锛夋垨鑰呰澶囧簳閮ㄧ殑鍥哄畾鐐**鍨傜洿瀵瑰噯**鍗佸瓧涓績銆 + - 淇濇寔璁惧鐨勬湞鍚戯紙渚嬪锛氬缁堝瀭鐩翠簬妗屽瓙杈圭紭锛夈 + - 鐐瑰嚮鈥滃紑濮嬪綍鍒垛濄 + +> **鈿狅笍 娉ㄦ剰**锛氫汉鎵嬪緢闅句繚璇佹瘡娆″炬枩瑙掑害瀹屽叏涓鑷达紝杩欎細瀵艰嚧鐢熸垚鐨勮建杩瑰湪鏃嬭浆锛圤rientation锛変笂浜х敓璇樊銆 + +--- + +### 鏂规浜岋細鐗╃悊鎸″潡娉曪紙鎺ㄨ崘锛屾渶甯哥敤锛 +**绮惧害锛氣瓙猸愨瓙猸 | 鎴愭湰锛氫綆** + +杩欐槸鎬т环姣旀渶楂樼殑鏂规硶锛岃兘鏈夋晥闄愬埗浣嶇疆鍜岃搴﹁宸 + +1. **鍑嗗**锛氬湪鎿嶄綔鍙拌竟缂橈紝浣跨敤閲嶇墿锛堝涓ゅ潡鏂规鐨勯搮鍧楋級鎴 3D 鎵撳嵃涓涓洿瑙掑簳搴э紙Dock锛夛紝鐢ㄥ己鍔涘弻闈㈣兌鍥哄畾鍦ㄦ闈笂銆 +2. **鏍囧畾**锛氭祴閲忔尅鍧楃殑鍐呰椤剁偣鍒版満鍣ㄤ汉鍩哄骇鐨勮窛绂伙紝濉叆 `base_position`銆 +3. **鎿嶄綔**锛 + - 姣忔褰曞埗鍓嶏紝灏嗘墜鎸佽澶囩殑鎵嬫焺搴曢儴**绱х揣闈犱綇**鎸″潡鐨勭洿瑙掑唴閮ㄣ + - 纭繚璁惧鐨勮儗闈㈣创绱ф尅鍧楃殑涓渚э紙淇濊瘉鏈濆悜涓鑷达級銆 + - 纭璁惧绋冲畾鍚庯紝鐐瑰嚮鈥滃紑濮嬪綍鍒垛濄 + - 褰曞埗寮濮嬪悗锛屽啀鎶婅澶囨嬁璧锋潵鍘绘墽琛屾搷浣溿 + +> **馃挕 鎻愮ず**锛氫綘鍙互鎯宠薄浣犲湪浣跨敤涓涓滃厖鐢靛簳搴р濄傛瘡娆″嚭闂ㄥ共娲诲墠锛岄兘蹇呴』浠庡簳搴т笂鎷斾笅鏉ャ傚惎鍔ㄧ殑閭d竴鍒伙紝璁惧蹇呴』瀹夌ǔ鍦板潗鍦ㄥ簳搴ч噷銆 + +--- + +### 鏂规涓夛細鏈哄櫒浜哄す鎸佹硶锛堟渶楂樼簿搴︼級 +**绮惧害锛氣瓙猸愨瓙猸愨瓙 | 鎴愭湰锛氶珮锛堥渶瑕佹搷浣滄満姊拌噦锛** + +濡傛灉浣犵殑缁堟瀬鐩爣鏄湪鐪熷疄鏈哄櫒浜轰笂杩涜姣背绾х殑鎶撳彇锛岃繖鏄渶涓ヨ皑鐨勬柟娉曘 + +1. **鍑嗗**锛氱紪鍐欎竴涓畝鍗曠殑鑴氭湰锛岃鐪熷疄鏈烘鑷傜Щ鍔ㄥ埌涓涓浐瀹氱殑鈥淗ome鈥濅綅缃紙渚嬪姝e墠鏂癸紝濮挎佸瀭鐩村悜涓嬶級銆 +2. **鎿嶄綔**锛 + - 鍦ㄥ綍鍒跺紑濮嬪墠锛屾搷浣滆呮嬁鐫 FastUMI 閲囬泦鍣紝灏嗛噰闆嗗櫒鐨勫す鐖笌鐪熷疄鏈哄櫒浜虹殑澶圭埅锛堟垨娉曞叞鐩樼壒瀹氫綅缃級**鐗╃悊瀵规帴**锛堜緥濡傦細浜掔浉鍜悎锛屾垨鑰呴潬姝伙級銆 + - 姝ゆ椂锛岄噰闆嗗櫒鐨勪綅濮胯鏈烘鑷傛姝婚檺鍒朵綇浜嗐 + - 绗簩涓汉鍦ㄧ數鑴戜笂鐐瑰嚮鈥滃紑濮嬪綍鍒垛濄 + - 褰曞埗寮濮嬪悗锛屾搷浣滆呯Щ寮閲囬泦鍣紝鍘绘墽琛屾紨绀哄姩浣溿 +3. **閰嶇疆**锛氭鏃 `config.json` 涓殑 `base_position` 灏辨槸鏈哄櫒浜鸿繖涓淗ome鈥濅綅缃殑绮剧‘鍧愭爣銆 + +--- + +## 3. 甯歌闂鎺掓煡 (Troubleshooting) + +| 鐜拌薄 | 鍙兘鍘熷洜 | 瑙e喅鍔炴硶 | +| :--- | :--- | :--- | +| **鏈哄櫒浜哄洖鏀炬椂锛屽姩浣滄绘槸鍋忓悜涓渚у嚑鍘樼背** | `base_position` 娴嬮噺涓嶅噯锛屾垨鑰呯墿鐞嗛敋鐐圭Щ鍔ㄤ簡銆 | 閲嶆柊鎷垮嵎灏虹簿纭祴閲忛敋鐐瑰埌鏈哄櫒浜哄簳搴х殑璺濈骞舵洿鏂 config銆 | +| **鏈哄櫒浜哄洖鏀炬椂锛岄珮搴︼紙Z杞达級瓒婃潵瓒婁綆锛屾渶鍚庣牳妗屽瓙** | T265 鍚姩鏃剁殑淇话瑙掞紙Pitch锛夋病瀵瑰噯銆傚惎鍔ㄦ椂鍙兘鎵嬫姈璁╄澶囧線涓嬪炬枩浜嗐 | 浣跨敤**鐗╃悊鎸″潡娉**锛岀‘淇濆惎鍔ㄦ椂璁惧鏄粷瀵瑰瀭鐩/姘村钩鐨勩 | +| **杞ㄨ抗鍋跺皵浼氣滅灛绉烩濇垨澶ц寖鍥存紓绉** | T265 鍦ㄩ噰闆嗚繃绋嬩腑闀滃ご琚伄鎸★紝鎴栬呭懆鍥寸幆澧冪壒寰佸お灏戯紙濡傚ぇ闈㈢Н鐧藉锛夈 | 淇濊瘉鐩告満瑙嗛噹娓呮櫚锛涘湪妗岄潰涓婃斁涓浜涙湁绾圭悊鐨勭墿浣撳府鍔 T265 瀹氫綅銆 | + +--- +**鎬荤粨**锛氭暟鎹噰闆嗙殑鐪熺悊鏄斺**鍨冨溇杩涳紝鍨冨溇鍑 (Garbage In, Garbage Out)**銆傝姳 10 鍒嗛挓鎼缓涓涓ǔ鍥虹殑瀵归綈鎸″潡锛岃兘涓轰綘鐪佸幓鍚庢湡鏁板ぉ鐨勯櫎閿欐椂闂淬 From 1308230c918aacd787d1c2f2f33beba9c565022f Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Thu, 21 May 2026 22:24:31 +0800 Subject: [PATCH 09/10] Add files via upload From c891a9d6ade2e568d4906ea0391537af757a34b7 Mon Sep 17 00:00:00 2001 From: tongzm <39787084+tongzm@users.noreply.github.com> Date: Thu, 21 May 2026 22:40:12 +0800 Subject: [PATCH 10/10] Add files via upload --- alignment_guide.md | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/alignment_guide.md b/alignment_guide.md index b0d3cb5..183848b 100644 --- a/alignment_guide.md +++ b/alignment_guide.md @@ -17,18 +17,18 @@ T265 杩借釜鐩告満锛堣瑙夐噷绋嬭锛夋病鏈夊唴寤虹殑缁濆鍧愭爣鎰熴傚綋浣犲惎 ```mermaid graph TD - subgraph 鐪熷疄涓栫晫 (浣犳兂鎶撶殑鏉瓙閮藉湪妗屽瓙涓ぎ) - Cup1((鏉瓙)) - Cup2((鏉瓙)) + subgraph "鐜板疄鐗╃悊绌洪棿 (鐩爣鏉瓙浣嶇疆鍥哄畾)" + Cup((鏉瓙)) end - subgraph T265鐪间腑鐨勪笘鐣 (鏁版嵁閿欎贡) - A[褰曞埗1: 绂绘澂瀛愯繙鐐瑰惎鍔╙ --> |鏁版嵁璁板綍| X1((鏉瓙鍧愭爣: x=10)) - B[褰曞埗2: 绂绘澂瀛愯繎鐐瑰惎鍔╙ --> |鏁版嵁璁板綍| X2((鏉瓙鍧愭爣: x=2)) + subgraph "T265 璁板綍鐨勬暟鎹 (鍥犲惎鍔ㄧ偣涓嶅悓鑰岄敊涔)" + A["婕旂ず 1: 鍦ㄨ繙鐐规寜涓嬪惎鍔"] -->|瀵艰嚧| X1(("鏁版嵁璁板綍: 鏉瓙鍦 10m 澶")) + B["婕旂ず 2: 鍦ㄨ繎鐐规寜涓嬪惎鍔"] -->|瀵艰嚧| X2(("鏁版嵁璁板綍: 鏉瓙鍦 2m 澶")) end - style Cup1 fill:#f9f,stroke:#333,stroke-width:2px + style Cup fill:#f9f,stroke:#333,stroke-width:2px style X1 fill:#ff9,stroke:#333,stroke-width:2px + style X2 fill:#ff9,stroke:#333,stroke-width:2px ``` ### 鉁 姝g‘鐨勫榻愶紙閿氱偣鏁堝簲锛 @@ -36,10 +36,10 @@ graph TD 閫氳繃鍦ㄦ瘡娆$偣鍑烩滃紑濮嬪綍鍒垛濅箣鍓嶏紝灏嗘墜鎸佽澶囨斁缃湪**鍚屼竴涓墿鐞嗛敋鐐**锛屾垜浠氨寮鸿鎶 T265 鐨勨滈殢鏈哄潗鏍囩郴鈥濆拰鈥滄満鍣ㄤ汉鐨勭粷瀵瑰潗鏍囩郴鈥濈粦瀹氬湪浜嗕竴璧枫 ```mermaid -flowchart LR - A[鐗╃悊閿氱偣\n(渚嬪锛氭瑙)] -->|姣忔閮藉湪姝ゅ惎鍔▅ B(T265: 杩欓噷鏄 0,0,0) - B -->|config.json 杞崲| C{鏈哄櫒浜哄熀搴:\n 閿氱偣浣嶄簬 x=0.5, z=0.3} - C -->|杈撳嚭鏈缁堟暟鎹畖 D[鎵鏈夊姩浣滆建杩圭簿鍑嗗榻怾 +graph TD + A["鐗╃悊閿氱偣\n(濡傦細妗岃)"] -->|鍥哄畾浣嶇疆鍚姩| B("T265: 杩欓噷鏄 0,0,0") + B -->|config.json 杞崲| C{"鏈哄櫒浜哄熀搴:\n 閿氱偣鍥哄畾浣嶄綅濮"} + C -->|杈撳嚭鏁版嵁| D["鎵鏈夊姩浣滆建杩瑰榻"] style A fill:#bbf,stroke:#333,stroke-width:2px style D fill:#bfb,stroke:#333,stroke-width:2px @@ -63,8 +63,6 @@ flowchart LR - 淇濇寔璁惧鐨勬湞鍚戯紙渚嬪锛氬缁堝瀭鐩翠簬妗屽瓙杈圭紭锛夈 - 鐐瑰嚮鈥滃紑濮嬪綍鍒垛濄 -> **鈿狅笍 娉ㄦ剰**锛氫汉鎵嬪緢闅句繚璇佹瘡娆″炬枩瑙掑害瀹屽叏涓鑷达紝杩欎細瀵艰嚧鐢熸垚鐨勮建杩瑰湪鏃嬭浆锛圤rientation锛変笂浜х敓璇樊銆 - --- ### 鏂规浜岋細鐗╃悊鎸″潡娉曪紙鎺ㄨ崘锛屾渶甯哥敤锛 @@ -80,8 +78,6 @@ flowchart LR - 纭璁惧绋冲畾鍚庯紝鐐瑰嚮鈥滃紑濮嬪綍鍒垛濄 - 褰曞埗寮濮嬪悗锛屽啀鎶婅澶囨嬁璧锋潵鍘绘墽琛屾搷浣溿 -> **馃挕 鎻愮ず**锛氫綘鍙互鎯宠薄浣犲湪浣跨敤涓涓滃厖鐢靛簳搴р濄傛瘡娆″嚭闂ㄥ共娲诲墠锛岄兘蹇呴』浠庡簳搴т笂鎷斾笅鏉ャ傚惎鍔ㄧ殑閭d竴鍒伙紝璁惧蹇呴』瀹夌ǔ鍦板潗鍦ㄥ簳搴ч噷銆 - --- ### 鏂规涓夛細鏈哄櫒浜哄す鎸佹硶锛堟渶楂樼簿搴︼級