Skip to content

Instantly share code, notes, and snippets.

View hewumars's full-sized avatar

Mars hewumars

View GitHub Profile
@hewumars
hewumars / h5_to_pb.py
Last active March 1, 2019 10:19
1.Keras H5转TF pb文件
from keras.models import load_model
import tensorflow as tf
import os
from keras import backend as K
#路径设置
input_path = 'weights/'
weight_file = '****.h5'
weight_file_path = os.path.join(input_path,weight_file)
output_graph_name = weight_file[:-3]+'.pb'
@hewumars
hewumars / demo1.c
Created January 22, 2019 02:22
For DeepStream
#include <gst/gst.h>
int main(int argc, char *argv[])
{
gst_init(&argc,&argv);//命令行输入的参数传递给GStreamer函数库
GstElement *pipeline, *filesrc, *decoder, *audiosink;//创建三个远见
pipeline = gst_pipeline_new("pipeline");//创建用于容纳元件的新管道
/*创建数据源元件*/
@hewumars
hewumars / assert.c
Last active February 27, 2019 00:51
#include <stdio.h>
#define HW_PAUSE() do {\
printf("---------------press Enter key to exit!---------------\n");\
getchar();\
} while (0)
#define HW_PRT(fmt...) \
do {\
printf("[%s]-%d: ", __FUNCTION__, __LINE__);\
//加载模型流程 //涉及的变量
HI_**_Param_S copParam[1];//自定义层参数结构体
static HI_RUNTIME_GROUP_INFO_S s_stGroupInfo;//模型组信息结构体,Load时用到
HI_RUNTIME_GROUP_HANDLE hGroupHandle;//句柄
HI_RUNTIME_WK_INFO_S astWkInfo[2];//wk模型信息,有几个模型就有多少元素
HI_RUNTIME_COP_ATTR_S stProposalAttr = {}; //custom operator自定义操作的属性
HI_RUNTIME_CONNECTOR_ATTR_S stConnectorAttr = {0};//连接器的属性
HI_CHAR acConfig[1024] = {0};//modelgroup文件读入的数组
memset(&stProposalAttr, 0, sizeof(HI_RUNTIME_COP_ATTR_S));
@hewumars
hewumars / readme.txt
Last active February 28, 2019 06:25
1.readme.txt随笔记录
DeNet在COCO上实现mAP:33.6%@79Hz,41.8%@5Hz
//permute
u32Offset = 0;
ps32InputBlob = pps32InputData[i];
u32ChnOffset = au32GridNumHeight[i]*au32Stride[i]/sizeof(HI_S32);
u32HeightOffset = au32Stride[i]/sizeof(HI_S32);
for (h = 0; h < au32GridNumHeight[i]; h++)
{
for (w = 0; w < au32GridNumWidth[i]; w++)
{
for (c = 0; c < SAMPLE_SVP_NNIE_YOLOV3_EACH_BBOX_INFER_RESULT_NUM*u32EachGridBbox; c++)
HI_U64 u64PhyAddrTmpBuf;
HI_S32 * pu32VirAddrTmpBuf;
HI_S32 *ps32TmpBuf=NULL;
//mmz名称,内存控制,物理地址,虚拟地址,size
s32Ret= SAMPLE_COMM_SVP_MallocMem("HIRTTmpBufSize",NULL,(HI_U64 *)&u64PhyAddrTmpBuf,(void**)&pu32VirAddrTmpBuf,u32TmpBufSize);
SAMPLE_CHECK_EXPR_RET(HI_SUCCESS!=s32Ret,s32Ret,"1SAMPLE_COMM_SVP_MallocMem:%x\n",pu32VirAddrTmpBuf);
ps32TmpBuf = pu32VirAddrTmpBuf;
  • 高质量数据优于花哨的算法
  1. 准确性
  2. 完整性
  3. 一致性
  4. 分布均匀性
  • 数据清洗的工作流程

说明

  1. 所有库均来自opencv 4.1.1版本
  2. 编译命令
mkdir build && cd build
cmake   -DBUILD_DOCS=off -DBUILD_SHARED_LIBS=off -DBUILD_FAT_JAVA_LIB=off -DBUILD_TESTS=off -DBUILD_TIFF=on -DBUILD_JASPER=off -DBUILD_JPEG=ON -DBUILD_ZLIB=on -DBUILD_OPENEXR=off -DBUILD_opencv_apps=off -DBUILD_opencv_calib3d=off -DBUILD_opencv_contrib=off -DBUILD_opencv_features2d=off -DBUILD_opencv_flann=off -DBUILD_opencv_gpu=off -DBUILD_opencv_java=off -DBUILD_opencv_legacy=off -DBUILD_opencv_ml=off -DBUILD_opencv_nonfree=off -DBUILD_opencv_objdetect=off -DBUILD_opencv_ocl=off -DBUILD_opencv_photo=off -DBUILD_opencv_python=off -DBUILD_opencv_stitching=off -DBUILD_opencv_superres=off -DBUILD_opencv_ts=off -DBUILD_opencv_video=off -DBUILD_opencv_videostab=off -DBUILD_opencv_world=off -DBUILD_opencv_lengcy=off -DBUILD_opencv_lengcy=off -DWITH_1394=off -DWITH_EIGEN=off -DWITH_FFMPEG=off -DWITH_GIGEAPI=off -DWITH_GSTREAMER=off -DWITH_GTK=off -DWITH_PVAPI=off  -DWITH_V4L=off -DWITH_LIBV4L=off -DWITH_CUDA=off -DWITH_CUFFT=off -DWITH_OPENCL=off -DWI
@hewumars
hewumars / NV21_TO_BGR.c
Last active March 5, 2019 07:00
YUV TO RGB
void NV21_T_RGB( unsigned char *yuyv , unsigned char *rgb,unsigned int width , unsigned int height )
{
const int nv_start = width * height ;
HI_U32 i, j, index = 0, rgb_index = 0;
HI_U8 y, u, v;
int r, g, b, nv_index = 0;
for(i = 0; i < height ; i++)
{