摘要: textgrid-python模块基础使用 import textgrid # 读取音频文件给定最大时长 tg=textgrid.TextGrid(minTime=0,maxTime=2) print(tg.__dict__) tier_word=textgrid.PointTier(name="w 阅读全文
posted @ 2021-08-03 13:02 得淼 阅读(1044) 评论(0) 推荐(0) 编辑
摘要: cv2.imdecode(np.fromfile(打开图片路径, dtype=np.uint8), cv2.COLOR_BGR2RGB) cv2.imencode('.jpg', 图像的array对象)[1].tofile(保存图片路径) 阅读全文
posted @ 2021-07-10 14:34 得淼 阅读(327) 评论(0) 推荐(0) 编辑
摘要: import os def traverse_dir(path, format=None): """ :param path: 文件夹路径 :param format: 要修改成的文件后缀,要加. :return:None """ for root, dirs, files in os.walk(p 阅读全文
posted @ 2021-07-03 01:16 得淼 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 灰度图像转化为二值图像 lbl_mask = lbl_mask.astype(np.uint8) # 转化为八进制 mask = lbl_mask[:] > 0 #lbl_mask为单通道,将所有大于0的像素取出,元素都为bool类型 lbl_mask[mask] = 255# 元素为True的赋值 阅读全文
posted @ 2021-06-02 11:55 得淼 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 本博客只是简陋记录当时使用Docker+Flask的操作 一、生成依赖包文件 首先执行pip freeze > requirement.txt 再加几行 gunicorn gevent flask gunicorn gevent 将requirement.txt文件放在项目根目录下 二、手写Dock 阅读全文
posted @ 2021-04-18 03:42 得淼 阅读(192) 评论(0) 推荐(0) 编辑
摘要: # coding: utf-8 from ftplib import FTP import time import tarfile import os # !/usr/bin/python # -*- coding: utf-8 -*- from ftplib import FTP class My 阅读全文
posted @ 2020-08-28 14:40 得淼 阅读(550) 评论(0) 推荐(0) 编辑
摘要: db.execute( table_name.__table__.insert(), [ { 'cizu' : i.cizu, 'identifier' : i.identifier, 'shouzimu' : i.shouzimu, 'raw_data' : i.raw_data, } for i 阅读全文
posted @ 2020-08-21 17:15 得淼 阅读(441) 评论(0) 推荐(0) 编辑
摘要: sqlalchemy 批量插入 db=Session() cizus=[ {'zi_id' : 1, 'cizu' : "cizu", 'raw_data' : "raw_data"}, {'zi_id' : 1, 'cizu' : "cizu", 'raw_data' : "raw_data"}, 阅读全文
posted @ 2020-08-19 11:43 得淼 阅读(2229) 评论(0) 推荐(1) 编辑
摘要: yuanyin_list = [ {"āáǎăà": [{"ā": "1"}, {"ă": "3"}, {"á": "2"}, {"ǎ": "3"}, {"à": "4"}], "yuanyin": "a"}, {"ōŏóǒò": [{"ō" 阅读全文
posted @ 2020-08-06 17:51 得淼 阅读(409) 评论(0) 推荐(0) 编辑
摘要: setattr、hasattr、getattr的用法 #要更新的数据 dic={ "pinyin": "yī bū zuò,èr bù xiū", "jieshi": "原意是要么不做,做了就索兴做到底。指事情既然做了开头,就索兴做到底。" } #类 class Coordinate : pinyi 阅读全文
posted @ 2020-08-06 15:08 得淼 阅读(120) 评论(0) 推荐(0) 编辑