Skip to content

Instantly share code, notes, and snippets.

View lartpang's full-sized avatar
💪
Completing a Ph.D...

Pang lartpang

💪
Completing a Ph.D...
View GitHub Profile
@lartpang
lartpang / OpenCV-build.md
Created August 2, 2022 05:52 — forked from Maghin/OpenCV-build.md
Build OpenCV 4.5.5 on Windows VS2019 with CUDA, DNN, Qt, TBB and more

Build OpenCV 4.5.5 on Windows VS2019 with CUDA, DNN, Qt, OpenGL, TBB, VTK.

This documentation explain how to build the latest OpenCV version - 4.4.5 20/02/2022 - from sources.

We will focus on C++ and not build any Python libs.

Prerequisites

Install theses tools with common option :

@lartpang
lartpang / GNN.py
Last active April 2, 2019 08:58
对3DGNN中使用的GNN的一些改动
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.
Args:
@lartpang
lartpang / converter.ipynb
Created March 28, 2019 15:56
pytorch借助onnx模型转换
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lartpang
lartpang / python的编码.py
Created March 25, 2019 16:06
一种针对平台编码方式编码的方法
# -*- coding:YTF-8 -*-
import sys
type = sys.getfilesystemencoding()
...
decode('UTF-8').encode(type)
@lartpang
lartpang / python的编码
Created March 25, 2019 16:06
一种针对平台编码方式编码的方法
# -*- coding:YTF-8 -*-
import sys
type = sys.getfilesystemencoding()
...
decode('UTF-8').encode(type)
@lartpang
lartpang / Material.css
Created March 3, 2019 01:46
博客园css
/**************************************************
说明:
1:我们建议你通过只改变css的方式来制作新的皮肤模板。当然,页面的部分代
码你也是可以更改的,例如一些图片的地址。但是,请你在递交作品的时候,请同时
提交对页面部分代码的修改备注和说明。以便我们了解。
2:为了保证页面的兼容性,请你分别在IE和Firefox中分别查看你的页面,以便保证页面
对浏览器的兼容性。
3:请你随时关注官方网站。以便获得最新的通知和说明
时间:2008-1-30
作者:杨正祎
@lartpang
lartpang / Keras-预训练-冻结-微调
Last active July 9, 2022 04:26
Keras预训练模型/按需分配显存/冻结层/独热编码解码输出/写文件/IoU/导出xml
#!/usr/bin/env python
import os
import tensorflow as tf
import keras.backend.tensorflow_backend as KTF
import numpy as np
from keras.layers import Dense, GlobalAveragePooling2D
from keras.models import Model
from keras.optimizers import Adam
from keras.preprocessing import image
" 设置状态行显示常用信息
" %F 完整文件路径名
" %m 当前缓冲被修改标记
" %m 当前缓冲只读标记
" %h 帮助缓冲标记
" %w 预览缓冲标记
" %Y 文件类型
" %b ASCII值
" %B 十六进制值
" %l 行数
@lartpang
lartpang / 导入文件夹内的图片数据
Last active October 9, 2018 09:11
获取文件夹下文件名/读取放缩图片/存储数据
# 获取文件名
import os
all_file = []
def file_name(path):
for file_name in os.listdir(path):
all_file.append(file_name)
path = 'test/'
file_name(path)
@lartpang
lartpang / 导出独热编码后的测试标签
Created October 9, 2018 09:08
导入文件/列表转换字符串/字符转化ascii码/独热编码/numpy存储npy
import numpy as np
from keras.utils import np_utils
# 导入测试标签
y_label = []
with open('label.txt', 'r') as label_file:
y_label = label_file.read().split()
print(y_label)
y_label_new = ''.join(y_label)