avatar
Articles
56
Tags
46
Categories
21

Home
Archives
Tags
Categories
List
  • 0
  • 1
Link
About
Search
Home
Archives
Tags
Categories
List
  • 0
  • 1
Link
About

lxml-usage
Created2020-01-16
OpenCV基础使用
Created2020-01-16|python
OpenCV中的坐标默认是图片(视频帧)的左上角为原点(0, 0),width对应x轴,height对应y轴,→为正x轴,↓为正y轴 图片裁剪直接用slicing即可,注意是[y, x]的表示方式,即: img[y_min:y_max, x_min:x_man] 默认是返回对应大小的图片 $H \times W \times C$ 但若裁剪的范围超过了原有图片大小,则返回$0 \times C$ 的结果, 强制保存这样的输出结果会出错 基于VideoCapture对视频的常用操作
tmux使用
Created2019-12-31|linux
tmux基础概念tmux使用详解 由tmux创建的终端都是处于三级结构的末级节点,也就是pane节点,默认情况下用tmux创建一个终端,则会创建一个session,session中会包含一个Window,这个window下包含一个pane,而这个pane就被认作是一个新的终端。 另外强烈推荐tmux wiki上推荐的书:The tao of tmux 上面这张图把所有的概念都说比较清楚了: server 和 client : server:对应着tmux server-client的机制。每当tmux运行时,都会启动tmux server; client:而访问session的时候,则对应一个client。同一个session,如果用几个不同的terminal访问,则对应多个client,因此tmux detach-client -s mysession -t /dev/ttys004 表示的是detach某个/dev/ttys004这一client,但是这个session其他的client(terminal)还是在运行的 When tmux starts, you ar ...
mmdetection源码解析
Created2019-12-04|mmdetection
train源码解析train部分有两个train.py文件,一个位于tools下,另一个位于mmdet/api下,tools下的是更高层的api,mmdet/api下的主要是定义了train_detector。二者的关系是: tools/train.py中调用mmdet/core/train.py中定义的train_detector。而train_detector又主要功能就是判断是多GPU分布式训练还是单GPU训练。 同时mmdet/core/train.py中还定义好了batch_processor以及它所调用的parse_losses,二者的作用如下: batch_processor就是执行一个batch的操作,在目标检测中对应某一个batch(2~3张imgs per gpu),以train为例,则batch_processor就是执行一个forward并把所有输出记录再outputs中 parse_losses,把outputs中的各个loss简单sum起来存到loss变量中,为后续回传梯度用。同时还把具 ...
mmdetection的使用基础
Created2019-11-25
基础概念ratio:高/宽 h/w如ratio=[0.5, 1.0, 2.0],则表示 scale:各边放大的倍数如scale=[8.],则对应的两条边都放大八倍,即最后的面积变为原来的64倍 获取经过MMDataParallel的模型的module MMDataParallel直接继承torch.nn.parallel.DataParallel,对于model,还需要用.module才能获得对应的model 获取到上面的module之后,直接通过.获取对应的模块就好了,比如: runner.model.module.bbox_head # obtain bbox_head module of faster rcnn
距离distance的一些理解
Created2019-11-24
euclidean distance euclidean distance 并不是 similarity,如果要normalize的的话,可以考虑: z变换,或者最直接的,x-min/max-min F=1 − exp(−x/λ) where λ is the average distance and x is the distance of the point you are evaluating. euclidean distance转化为similarity的方法其实有不少,具体选用哪个应该根据自己的问题来确定,比如如下的就可以考虑: $dist=1−sim, dist=1−simsim, dist=\sqrt{1−sim}, dist=−\log(sim)$ $\frac{1}{1+d(p_1, p_2)}$ 其实这些就是kernel,因此具体搜索的时候可以检索machine learning kernel来看 真的要完全理解,可以查阅这本书 Encyclopedia of Distance ...
docker基础
Created2019-11-14
在Dockerfile中更改apt(等)的源路径直接通过ADD命令即可。对于apt-get来说,直接新建一个sources.list然后添加进去即可 ADD sources.list /etc/apt 软链(symlink)在docker中是基本不可用的 对于需要在container中直接使用的文件,用挂载即可-v 对于在Dockerfile中使用的文件,则需要用COPY或者ADD使用即可 Dockerfile中ADD, COPY的路径问题根据官网的docs,应该是只接受absolute path或者path relative to WORKDIR 因此最好用绝对路劲,如用/roor/代替~ Dockerfile中更改时区ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 解决docker tty尺寸过小的问题Strange terminal behaviour inside docker 直接用设定COLUMNS和LINES环境变量并不好用,反而只是如上的命令最好 docker exec -it container ...
tqdm使用
Created2019-10-30|python
Basic 最直接的就是用tqdm把一个itereble object wrap起来,然后直接用: with tqdm(range(config['INCV_epochs']), desc='INCV iter:{}'.format(kwargs['INCV_iter']), unit='epoch') as t: for epoch in t: 或者是自己手动update: with tqdm(total=10, bar_format="{postfix[0]} {postfix[1][value]:>8.2g}", postfix=["Batch", dict(value=0)]) as t: for i in range(10): sleep(0.1) t.postfix[1]["value"] = i / 2 t.update() set_postfix(), set_description()的用法 set_postfix() ...
github使用
Created2019-10-27
github删除子模块参考这个 git submodule deinit <asubmodule> git rm <asubmodule> # Note: asubmodule (no trailing slash) # or, if you want to leave it in your working tree git rm --cached <asubmodule> rm -rf .git/modules/<asubmodule> 插入自定义代码块snippet generator 直接在上述网址中输入即可 删除remote上的commit 思路就是先从本地的log中找出所需的commit,然后本地先回滚,然后push -f 强行改写remote上的记录即可 具体操作如下: 通过revert来(commit还是保留了下来) 首先通过 git log 获得所有commit 挑选出需要的 git revert <commit> git push -f <remote> 通过reset来(之后的commit都丢弃 ...
pytorch分布式训练初探
Created2019-10-11|pytorch
基础概念:进程、线程进程即process,线程即thread,从知乎的回答上看,可以了解到,线程是比进程更细粒度的划分,二者均表示占用资源(CPU、内存、IO等)的时间 world_size, rankworld_size本质就是指 进程总数,而rank则指的是 当前的进程 如果是单机多卡的模式,则world_size可以认为是 该卡的GPU总数,rank可以认为是每个GPU对应的进程(如果一个GPU开一个进程的话) 如果是多机多卡的模式,则world_size可以认为是 所有卡加起来的GPU总数,rank可以认为是每个GPU对应的进程(如果一个GPU开一个进程的话)。rank必须是exclusive的,否则会有重叠。但是此时要注意,如果需要手动在不同的node上面分别开启terminal来实现多进程,那么在指定cuda device(torch.cuda.set_device)时,必须用那个node上面的相对rank,因为每个node 上面的gpu都是从0开始计数的。 如果要一个rank(一个进程)同时使用好几个GPU的话,那么总的world_size则为total_num_gpu ...
1…3456
avatar
Walter
Articles
56
Tags
46
Categories
21
Follow Me
Announcement
This is my Blog
Recent Post
pve安装使用全流程2022-06-26
hexo algolia 使用2021-10-16
hexo new 时的路径创建2021-10-16
gitignore忽略整个文件夹下所有文件但保留一些2021-08-20
github多账号设置2021-08-07
Categories
  • graph1
  • hexo2
  • hydra1
  • linux4
  • mmdetection1
  • nas1
  • noisy-labels1
  • optuna1
Tags
Datalodaer GFW Mac OpenCV Sampler attention basic configparser distributed training docker generator git github hexo hydra io ipython joblib jupyter_lab linux logging matplotlib meta learning mmdetection networkx noisy-labels optuna pandas pve pycharm pyspark python pytorch screen server shell sklearn spacevim ssh submitit
Archives
  • June 20221
  • October 20212
  • August 20212
  • July 20211
  • February 20216
  • January 20217
  • June 20204
  • May 20202
Info
Article :
56
Total Count :
82.7k
UV :
PV :
Last Push :
©2020 - 2022 By Walter
Framework Hexo|Theme Butterfly
Search