conda安装

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod +x Miniconda3-latest-Linux-x86_64.sh ./Miniconda3-latest-Linux-x86_64...

git和conda设置

#### 配置git ssh - 生成:ssh-keygen -t rsa -b 4096 -C "1049598673@qq.com" - cd /home/.ssh - cat id_rsa.pub - 这里配置:https://github.com/settings/keys...

mysql 问题:2006, MySQL server has gone away ConnectionResetError 10054, 远程主机强迫关闭了一个现有的连接None10054None

参考文章:https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away cat /etc/my.cnf sudo vim /etc/my.cnf max_allowed_packet=5...

centos7 目录压缩

```压缩 tar -cvf log.tar ./* ``` ```下载 sz log.tar ```...

ChineseClip验证测试

~~~ import os.path import subprocess import numpy as np import torch import xlsxwriter from PIL import Image import cn_clip.clip as clip from cn_clip....

图片马赛克

...

python 生成随机颜色值

~~~ import random def random_color(): # 生成随机颜色值 r = lambda: random.randint(0, 255) color = f"#{r():02x}{r():02x}{r():02x}" print(color) return color ~...

Matplotlib中文显示问题

~~~ def show_chinese(): # 显示中文 plt.rcParams["font.sans-serif"] = ['SimHei', 'simsun', 'Songti SC', 'STFangsong'] plt.rcParams["axes.unicode_minus"] = ...

FFmpeg视频抽帧

~~~ cmd_frames = f"ffmpeg -i {video_path} -filter:v fps=1/{space} {output_img_path} -loglevel quiet" my_print(f"执行的ffmpeg命令:{cmd_frames}") ffmpeg_code...

ffmpeg视频去水印

~~~ x, y, w, h = watermark.split(",") # https://www.jianshu.com/p/dfcfd4432367 # x,y的起始值是从1开始,从0开始会报错 if int(x) == 0: x = 1 if int(y) == 0: y = 1 w, h...