2024年1月15日

获取前N大与前N小的list索引

摘要: import numpy as np arr = np.array(class_org) #前15大 maxt = arr.argsort()[-15:][::-1] #前15小 mint = arr.argsort()[:15] argsort会从小到大返回索引值。 阅读全文

posted @ 2024-01-15 16:41 MonsterPPPP 阅读(6) 评论(0) 推荐(0)

2023年11月10日

Python Tricks

摘要: 1. 同时按照一个list的大小排序两个list def return_sorted_list(cclass): namelist = [] numlist = [] for cat in cclass.cat: namelist.append(cat.catName) numlist.append 阅读全文

posted @ 2023-11-10 10:38 MonsterPPPP 阅读(13) 评论(0) 推荐(0)

【数据处理脚本】字符串

摘要: 1. 检测一个字符串内是否有中文 # 检测字符串是否含有中文 def is_contain_chinese(check_str): for ch in check_str: if u'\u4e00' <= ch <= u'\u9fff': return True return False 2. 去除 阅读全文

posted @ 2023-11-10 10:36 MonsterPPPP 阅读(8) 评论(0) 推荐(0)

【数据可视化】matplotlib画图设置

摘要: 1.全局更改图表外观 plt.style.use("ggplot") 2.全局更改图片内的字体/可每次画图都重新定义一下个性化 plt.rc('font',family='Times New Roman', size=20) 3. 画竖直排列的柱状图 def visualization(nameli 阅读全文

posted @ 2023-11-10 10:28 MonsterPPPP 阅读(45) 评论(0) 推荐(0)

2023年10月8日

【脚本】逐行读取txt文件

摘要: file_name = "train_names.txt" video_names = [] with open(file_name,"r" ) as f : for line in f: video_names.append(line.strip("\n")) print(video_names) 阅读全文

posted @ 2023-10-08 16:40 MonsterPPPP 阅读(38) 评论(0) 推荐(0)

2023年9月28日

【脚本】统计视频的帧数、fps、时长、以固定fps进行采样后的时长

摘要: 输入:存放有很多视频文件的文件夹路径 输出:包含采样前后视频信息的csv文件 import os import cv2 import pandas as pd import numpy as np from PIL import Image def get_videos(vidname, read_ 阅读全文

posted @ 2023-09-28 17:47 MonsterPPPP 阅读(141) 评论(0) 推荐(0)

2023年9月27日

【指令备忘录】git快速配置与操作

摘要: 远程仓库初始化配置流程: 密钥配对: window电脑: 在c盘/用户/用户名文件夹/.ssh 文件夹内打开bash 输入指令 ssh-kengen 生成.pub公钥 黏贴到github仓库的用户 settings里面即可 在git/github上建立远程仓库 本地需要的位置仓库初始化 git in 阅读全文

posted @ 2023-09-27 11:38 MonsterPPPP 阅读(48) 评论(0) 推荐(0)

2022年11月3日

【服务器】购买后云服务器基本环境部署

摘要: windows电脑->linux云服务器 windows 安装插件: 1. Hyper 命令行软件,用于连接服务器 2. winscp 图形化文件传输软件 基本配置 1.配置ssh无密码访问云服务器: https://blog.csdn.net/qq_43780850/article/details 阅读全文

posted @ 2022-11-03 11:51 MonsterPPPP 阅读(32) 评论(0) 推荐(0)

导航