Skip to content

Instantly share code, notes, and snippets.

View nanmi's full-sized avatar
😉
Atypical AI practitioners

nanmi

😉
Atypical AI practitioners
View GitHub Profile
@nanmi
nanmi / data_format.md
Last active August 30, 2021 02:26
各种数据集格式

各种数据集的数据格式


Kitti格式

example:

Pedestrian 0.00 0 -0.20 712.40 143.00 810.73 307.92 1.89 0.48 1.20 1.84 1.47 8.41 0.01

| 字段 | 含义 | 说明 |

@nanmi
nanmi / export_onnx.md
Last active August 17, 2021 09:23
pytorch导出onnx的两种方式

pytorch导出onnx的两种方式(静态输入&动态输入)

以resnet18为例

import onnx 
import torch
import torchvision 
import netron
@nanmi
nanmi / ncnn_Mat_opencv_Mat.md
Last active July 14, 2022 02:10
ncnn Mat 和 opencv Mat相互转换

opencv Mat to ncnn Mat

  • cv::Mat CV_8UC3 -> ncnn::Mat 3 channel + swap RGB/BGR
// cv::Mat a(h, w, CV_8UC3);
ncnn::Mat in = ncnn::Mat::from_pixels(a.data, ncnn::Mat::PIXEL_BGR2RGB, a.cols, a.rows);
  • cv::Mat CV_8UC3 -> ncnn::Mat 3 channel + keep RGB/BGR order
@nanmi
nanmi / install_xmake.md
Last active June 15, 2021 04:40
Install xmake

xmake安装和使用教程

https://xmake.io/#/zh-cn/about/course

安装xmake

$ git clone --recursive https://github.com/xmake-io/xmake.git
$ cd ./xmake 
$ ./scripts/get.sh __local__ 
$ source ~/.xmake/profile
#如果觉得github的源太慢,可以通过gitee的镜像源拉取:
@nanmi
nanmi / pypy.md
Last active June 15, 2021 04:41
PyPy加速python

PyPy安装及加速Python代码

首先安装PyPy环境

下载地址:https://downloads.python.org/pypy/

解压

创建使用pypy的virtualenv

mkvirtualenv -p {解压好的路径}/bin/pypy {virtualenv name}

OK!!

@nanmi
nanmi / modify_port.md
Last active November 23, 2021 10:43
How to modify port when container running

容器启动后增加 端口映射 和 挂载目录

增加 端口映射

停止docker服务(一定要,否则修改会自动还原)
sudo systemctl stop docker

修改/var/lib/docker/containers/[hash_of_the_container]/hostconfig.json/var/lib/docker/containers/[hash_of_the_container]/config.v2.json

修改hostconfig.json
@nanmi
nanmi / ubuntu_modify_host_user.md
Last active June 15, 2021 04:38
ubuntu修改用户名和主机名
@nanmi
nanmi / connect.md
Last active June 30, 2023 02:29
SSH connect to docker container

Docker容器ssh远程连接

1.Ubuntu 版本

安装ssh
apt update
apt install openssh-server
/etc/init.d/ssh start
修改ssh配置文件
@nanmi
nanmi / install_deep_stream.md
Last active June 13, 2024 06:44
Install DeepStream6

安装DeepStream


安装依赖

$ sudo apt install libjson-glib-dev libjansson4 libvtk6-dev python-vtk6 openssl libssl-dev ffmpeg libx11-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio gstreamer1.0-rtsp libgstreamer-plugins-base1.0-dev libgstreamer1.0-0 libgstreamer1.0-dev libgstrtspserver-1.0-0 libgstrtspserver-1.0-dev 
sudo apt-get install libv4l-dev
cd /usr/include/linux
sudo ln -s ../libv4l1-videodev.h videodev.h