- 博客(12)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注
原创 python 合并多层嵌套字典的方法——递归函数
本函数只对dict类型的值进行合并,其他类型(str, int, list, tuple等)仅仅进行覆盖。个人认为,这样也符合大多数场景的需求。作者本人是因为要合并深度学习框架的配置文件而写的这个函数,在此场景是不需要合并list,tuple的。此函数利用递归函数,实现了任意层级value问字典的合并功能,相同的键值(非dict)以dict_2优先。在很多场景中,需要用到合并复杂字典的功能,即字典的某些value是字典,此字典的某些value还是字典。输出结果如下,正确。暂未进行更多测试用例测试。...
2022-08-19 09:38:55 1650
原创 Python+zmq实现负载均衡
# encoding: utf-8import zmqimport timeimport randomfrom threading import Threadfrom vbsl.config import *from vbsl.get_logs import *from vbsl.parse_logs import *NBR_WORKERS = 30def worker_thread(context=None): context = context or zmq.Cont.
2021-10-09 13:41:03 410
原创 get frame from video and generate yolo annotation
get frame from video and generate yolo annotationimport cv2import osimport csvimport xml.dom.minidom as Documentimport xml.dom.minidom as parseStringimport pandas as pdimport numpy as npimport dicttoxmlclass Size(): def __init__(self, heigh
2020-08-07 14:28:20 162
转载 VOC xml格式标注转换为yolo格式
import xml.etree.ElementTree as ETimport pickleimport osfrom os import listdir, getcwdfrom os.path import joinimport syssets=[('2018', 'train'), ('2018', 'val')]classes = ["a", "b", "c", "d"]# soft link your VOC2018 under hereroot_dir = sys.
2020-08-05 15:04:05 1422 1
原创 python opencv数据集制作
python opencv数据集制作代码import osimport cv2import numpy as npdef background(frame): gray = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) ret, binary = cv2.threshold(gray, 112, 255, cv2.THRESH_BINARY_INV) kernel = cv2.getStructuringElement(cv2.MORPH
2020-08-02 12:20:35 576
原创 Frequency domain filtering
#include <iostream>#include <unistd.h>#include <opencv2/imgcodecs.hpp>#include <opencv2/imgproc.hpp>using namespace cv;using namespace std;void fftshift(const Mat& in...
2020-01-21 11:14:59 433
原创 Something about CentOS and Django
CentOS 7 初始设置将用户加入sudoersusermod -aG wheel newuser设置开机启动网络cd /etc/sysconfig/network-scripts ls -a vi ifcfg-ens33将ONBOOT=no 改成ONBOOT=yes 保存后退出。How to Install Python 3 on CentOS 7sud...
2019-09-27 15:46:52 82
原创 常用linux及shell脚本命令
curl请求curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":100}' http://localhost/test/addusershell脚本获取文件列表shell脚本列出文件名并保存#!/bin/bash# get all filename in...
2019-09-27 15:44:50 144
原创 三菱Q/L系列PLC 基于ftp功能实现OTA(远程升级)
基于Q/L系列PLC内置的ftp功能,实现了远程升级PLC程序的功能。升级程序可以应用在Windows和linux系统,如有需要,可以联系我。Email:[email protected]
2019-09-16 17:20:36 1257
原创 基于三菱PLC ST语言的FIFO实现
自己写一个FB实现FIFO功能,相比系统提供的更加灵活方便。这个只是初步实现了先入先出的功能,并没有进行充分的测试。
2018-07-04 13:12:29 5570
esp32-2.0.6 tools packages for Arduino IDE
2023-02-17
How to Get IPC MJPEG Stream via HTTP Commands.pdf
2021-01-07
如何使用python-opencv判断两张有偏移的图片是否存在异物差别
2019-12-25
TA创建的收藏夹 TA关注的收藏夹
TA关注的人