'잡동사니'에 해당되는 글 13317건
- 2022.04.14 ai 컨퍼런스
- 2022.04.13 ssd_inception_v2_coco_2017_11_17.tar.gz
- 2022.04.13 nvidia jetson deepstream objectDetector_SSD 플러그인 분석
- 2022.04.13 nvidia jetson deepstream objectDetector_SSD 실행 스크립트 분석
- 2022.04.13 digital twin
- 2022.04.13 golang module
- 2022.04.12 python openCV / PIL 포맷 변경
- 2022.04.12 파이썬 딕셔너리 변수 생성과 리턴 enumerate, zip
- 2022.04.11 golang 구조체
- 2022.04.11 golang defer와 if
netron 웹 버전에서 받아서 보는 중
받아볼 녀석은 아래의 링크이고..
[링크 : http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2017_11_17.tar.gz]
어떤 이름의 레이어에서 출력을 내주는지 한번 찾아보는 중
크게 4개인 것 같고 명칭은 아래와 같은데..
detection_boxes, detection_scores, detection_classes, num_detections
detection_boxes의 경우 4개 좌표로 나와있을줄 알았는데 단순히 float32라고만 되어있어서 멘붕..
'embeded > jetson' 카테고리의 다른 글
deepstream SSD (0) | 2022.04.15 |
---|---|
deepstream (0) | 2022.04.15 |
nvidia jetson deepstream objectDetector_SSD 플러그인 분석 (0) | 2022.04.13 |
nvidia jetson deepstream objectDetector_SSD 실행 스크립트 분석 (0) | 2022.04.13 |
jetson / armv8 EL (0) | 2022.04.07 |
코드 기본 구조만 남기고 상세 코드는 분석을 위해 삭제
$ cat nvdsiplugin_ssd.cpp #include "NvInferPlugin.h" #include <vector> #include "cuda_runtime_api.h" #include <cassert> #include <cublas_v2.h> #include <functional> #include <numeric> #include <algorithm> #include <iostream> using namespace nvinfer1; class FlattenConcat : public IPluginV2 { public: FlattenConcat(int concatAxis, bool ignoreBatch) : mIgnoreBatch(ignoreBatch) , mConcatAxisID(concatAxis) { assert(mConcatAxisID == 1 || mConcatAxisID == 2 || mConcatAxisID == 3); } //clone constructor FlattenConcat(int concatAxis, bool ignoreBatch, int numInputs, int outputConcatAxis, int* inputConcatAxis) : mIgnoreBatch(ignoreBatch) , mConcatAxisID(concatAxis) , mOutputConcatAxis(outputConcatAxis) , mNumInputs(numInputs) { CHECK(cudaMallocHost((void**) &mInputConcatAxis, mNumInputs * sizeof(int))); for (int i = 0; i < mNumInputs; ++i) mInputConcatAxis[i] = inputConcatAxis[i]; } FlattenConcat(const void* data, size_t length) { } ~FlattenConcat() { } int getNbOutputs() const noexcept override { return 1; } Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) noexcept override { } int initialize() noexcept override { } void terminate() noexcept override { } size_t getWorkspaceSize(int) const noexcept override { return 0; } int enqueue(int batchSize, void const* const* inputs, void* const* outputs, void*, cudaStream_t stream) noexcept override { } size_t getSerializationSize() const noexcept override { } void serialize(void* buffer) const noexcept override { } void configureWithFormat(const Dims* inputs, int nbInputs, const Dims* outputDims, int nbOutputs, nvinfer1::DataType type, nvinfer1::PluginFormat format, int maxBatchSize) noexcept override { } bool supportsFormat(DataType type, PluginFormat format) const noexcept override { } const char* getPluginType() const noexcept override { return "FlattenConcat_TRT"; } const char* getPluginVersion() const noexcept override { return "1"; } void destroy() noexcept override { delete this; } IPluginV2* clone() const noexcept override { } void setPluginNamespace(const char* libNamespace) noexcept override { mNamespace = libNamespace; } const char* getPluginNamespace() const noexcept override { return mNamespace.c_str(); } private: template <typename T> void write(char*& buffer, const T& val) const { } template <typename T> T read(const char*& buffer) { } size_t* mCopySize = nullptr; bool mIgnoreBatch{false}; int mConcatAxisID{0}, mOutputConcatAxis{0}, mNumInputs{0}; int* mInputConcatAxis = nullptr; nvinfer1::Dims mCHW; cublasHandle_t mCublas; std::string mNamespace; }; namespace { const char* FLATTENCONCAT_PLUGIN_VERSION{"1"}; const char* FLATTENCONCAT_PLUGIN_NAME{"FlattenConcat_TRT"}; } // namespace class FlattenConcatPluginCreator : public IPluginCreator { public: FlattenConcatPluginCreator() { mPluginAttributes.emplace_back(PluginField("axis", nullptr, PluginFieldType::kINT32, 1)); mPluginAttributes.emplace_back(PluginField("ignoreBatch", nullptr, PluginFieldType::kINT32, 1)); mFC.nbFields = mPluginAttributes.size(); mFC.fields = mPluginAttributes.data(); } ~FlattenConcatPluginCreator() {} const char* getPluginName() const noexcept override { return FLATTENCONCAT_PLUGIN_NAME; } const char* getPluginVersion() const noexcept override { return FLATTENCONCAT_PLUGIN_VERSION; } const PluginFieldCollection* getFieldNames() noexcept override { return &mFC; } IPluginV2* createPlugin(const char* name, const PluginFieldCollection* fc) noexcept override { } IPluginV2* deserializePlugin(const char* name, const void* serialData, size_t serialLength) noexcept override { return new FlattenConcat(serialData, serialLength); } void setPluginNamespace(const char* libNamespace) noexcept override { mNamespace = libNamespace; } const char* getPluginNamespace() const noexcept override { return mNamespace.c_str(); } private: static PluginFieldCollection mFC; bool mIgnoreBatch{false}; int mConcatAxisID; static std::vector<PluginField> mPluginAttributes; std::string mNamespace = ""; }; PluginFieldCollection FlattenConcatPluginCreator::mFC{}; std::vector<PluginField> FlattenConcatPluginCreator::mPluginAttributes; REGISTER_TENSORRT_PLUGIN(FlattenConcatPluginCreator); |
$ cat nvdsparsebbox_ssd.cpp #include <cstring> #include <iostream> #include "nvdsinfer_custom_impl.h" #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define CLIP(a,min,max) (MAX(MIN(a, max), min)) /* This is a sample bounding box parsing function for the sample SSD UFF * detector model provided with the TensorRT samples. */ extern "C" bool NvDsInferParseCustomSSD (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, NvDsInferParseDetectionParams const &detectionParams, std::vector<NvDsInferObjectDetectionInfo> &objectList); /* C-linkage to prevent name-mangling */ extern "C" bool NvDsInferParseCustomSSD (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, NvDsInferParseDetectionParams const &detectionParams, std::vector<NvDsInferObjectDetectionInfo> &objectList) { for (int i = 0; i < keepCount; ++i) { NvDsInferObjectDetectionInfo object; object.classId = classId; object.detectionConfidence = det[2]; object.left = CLIP(rectx1, 0, networkInfo.width - 1); object.top = CLIP(recty1, 0, networkInfo.height - 1); object.width = CLIP(rectx2, 0, networkInfo.width - 1) - object.left + 1; object.height = CLIP(recty2, 0, networkInfo.height - 1) - object.top + 1; objectList.push_back(object); } return true; } /* Check that the custom function has been defined correctly */ CHECK_CUSTOM_PARSE_FUNC_PROTOTYPE(NvDsInferParseCustomSSD); |
+ ?
+
NvDsInferDataType dataType union { NvDsInferDims inferDims }; int bindingIndex const char * layerName void * buffer int isInput |
'embeded > jetson' 카테고리의 다른 글
deepstream (0) | 2022.04.15 |
---|---|
ssd_inception_v2_coco_2017_11_17.tar.gz (0) | 2022.04.13 |
nvidia jetson deepstream objectDetector_SSD 실행 스크립트 분석 (0) | 2022.04.13 |
jetson / armv8 EL (0) | 2022.04.07 |
nvidia jetson partition table (0) | 2022.04.06 |
- With gst-launch-1.0 For Jetson: $ gst-launch-1.0 filesrc location=../../samples/streams/sample_1080p_h264.mp4 ! \ decodebin ! m.sink_0 nvstreammux name=m batch-size=1 width=1280 height=720 ! \ nvinfer config-file-path= config_infer_primary_ssd.txt ! \ nvvideoconvert ! nvdsosd ! nvegltransform ! nveglglessink - With deepstream-app $ deepstream-app -c deepstream_app_config_ssd.txt |
$ cat deepstream_app_config_ssd.txt [application] enable-perf-measurement=1 perf-measurement-interval-sec=1 gie-kitti-output-dir=streamscl [tiled-display] enable=0 rows=1 columns=1 width=1280 height=720 gpu-id=0 nvbuf-memory-type=0 [source0] enable=1 #Type - 1=CameraV4L2 2=URI 3=MultiURI type=3 num-sources=1 uri=file://../../samples/streams/sample_1080p_h264.mp4 gpu-id=0 cudadec-memtype=0 [streammux] gpu-id=0 batch-size=1 batched-push-timeout=-1 ## Set muxer output width and height width=1920 height=1080 nvbuf-memory-type=0 [sink0] enable=1 #Type - 1=FakeSink 2=EglSink 3=File type=2 sync=1 source-id=0 gpu-id=0 [osd] enable=1 gpu-id=0 border-width=3 text-size=15 text-color=1;1;1;1; text-bg-color=0.3;0.3;0.3;1 font=Serif show-clock=0 clock-x-offset=800 clock-y-offset=820 clock-text-size=12 clock-color=1;0;0;0 nvbuf-memory-type=0 [primary-gie] enable=1 gpu-id=0 batch-size=1 gie-unique-id=1 interval=0 labelfile-path=/home/nvidia/tmp_onnx/labels.txt #labelfile-path=ssd_coco_labels.txt model-engine-file=sample_ssd_relu6.uff_b1_gpu0_fp32.engine config-file=config_infer_primary_ssd.txt nvbuf-memory-type=0 |
$ cat config_infer_primary_ssd.txt [property] gpu-id=0 net-scale-factor=0.0078431372 offsets=127.5;127.5;127.5 model-color-format=0 # yw onnx-file=/home/nvidia/tmp_onnx/model.onnx labelfile=/home/nvidia/tmp_onnx/labels.txt model-engine-file=sample_ssd_relu6.uff_b1_gpu0_fp32.engine labelfile-path=ssd_coco_labels.txt uff-file=sample_ssd_relu6.uff infer-dims=3;300;300 uff-input-order=0 uff-input-blob-name=Input batch-size=1 ## 0=FP32, 1=INT8, 2=FP16 mode network-mode=2 num-detected-classes=91 interval=0 gie-unique-id=1 is-classifier=0 output-blob-names=MarkOutput_0 parse-bbox-func-name=NvDsInferParseCustomSSD custom-lib-path=nvdsinfer_custom_impl_ssd/libnvdsinfer_custom_impl_ssd.so #scaling-filter=0 #scaling-compute-hw=0 [class-attrs-all] threshold=0.5 roi-top-offset=0 roi-bottom-offset=0 detected-min-w=0 detected-min-h=0 detected-max-w=0 detected-max-h=0 ## Per class configuration #[class-attrs-2] #threshold=0.6 #roi-top-offset=20 #roi-bottom-offset=10 #detected-min-w=40 #detected-min-h=40 #detected-max-w=400 #detected-max-h=800 |
'embeded > jetson' 카테고리의 다른 글
ssd_inception_v2_coco_2017_11_17.tar.gz (0) | 2022.04.13 |
---|---|
nvidia jetson deepstream objectDetector_SSD 플러그인 분석 (0) | 2022.04.13 |
jetson / armv8 EL (0) | 2022.04.07 |
nvidia jetson partition table (0) | 2022.04.06 |
jetson nano 부팅이 안됨 (0) | 2022.04.06 |
디지털 트윈은.. 테슬라 자율주행의 컨셉이라고 하면 쉽게 이해가 되려나?
현실을 스캔해서 가상현실로 끌어오고
그걸 이용해 다양하게 분석, 시뮬레이션 하여 최적의 운전을 하는 것
그 대상이 빌딩일 수도 있고, 땅일수도 있고 특정 물건일 수도 있다.
[링크 : https://matterport.com/ko/what-digital-twin]
[링크 : https://redshift.autodesk.co.kr/what-is-a-digital-twin/]
디지털 트윈은 물리적 객체, 프로세스, 관계, 행동을 포함하는 실세계의 가상 표현입니다. GIS는 자연 및 인공 환경의 디지털 트윈을 생성하며 다양한 유형의 디지털 모델을 고유하게 통합합니다. |
[링크 : https://www.esri.com/ko-kr/digital-twin/overview]
‘디지털 트윈(Digital-Twin)’이란? 실제 장비나 공간을 가상 세계에 쌍둥이처럼 똑같이 구현하는 기술이에요. |
[링크 : https://www.korea.kr/news/visualNewsView.do?newsId=148876722]
'이론 관련 > 컴퓨터 관련' 카테고리의 다른 글
DR - Disaster Recovery Plan (0) | 2022.10.17 |
---|---|
SLP - Superword Level Parallelism (0) | 2022.06.02 |
current loop to rs232 (0) | 2021.10.22 |
usb dwc (0) | 2021.09.23 |
fp16 (0) | 2021.05.10 |
C언어 처럼 단순(?)한게 아니라 자바의 패키지 처럼
모듈로 만들어야 끌어올 수 있다고 한다.
[링크 : https://tutorialedge.net/golang/go-modules-tutorial/]
[링크 : https://www.digitalocean.com/community/tutorials/how-to-use-go-modules]
'Programming > golang' 카테고리의 다른 글
golang websocket package (0) | 2022.07.15 |
---|---|
go run ./ (2) | 2022.04.18 |
golang 구조체 (0) | 2022.04.11 |
golang defer와 if (0) | 2022.04.11 |
golang a tour of go offline (0) | 2022.04.07 |
필요한 건 openCV로 받아 PIL로 변환하는거라 아래것만 테스트 해봄
import cv2 from PIL opencv_image=cv2.imread(".\\learning_python.png") color_coverted = cv2.cvtColor(opencv_image, cv2.COLOR_BGR2RGB) pil_image=PIL.Image.fromarray(color_coverted) |
[링크 : https://www.zinnunkebi.com/python-opencv-pil-convert/]
'Programming > python(파이썬)' 카테고리의 다른 글
pyplot (0) | 2023.10.04 |
---|---|
python matplotlib 설치 (0) | 2023.03.08 |
파이썬 딕셔너리 변수 생성과 리턴 enumerate, zip (0) | 2022.04.12 |
python interactive mode (0) | 2022.03.15 |
python3 opencv2 checker board (0) | 2022.03.14 |
발견하게 된 생소한 문법은 아래와 같은데..
enumerate() 함수를 이용해 이름 목록을 열거하고 인덱스와 함께
name(키) 와 outputs 라는 구조를 쌍으로 묶어 딕셔너리로 돌려준다.
return {name: outputs[i] for i, name in enumerate(self.output_names)} |
def create_dict(): ''' Function to return dict ''' return {i:str(i) for i in range(10)} numbers = create_dict() print(numbers) # {0: '0', 1: '1', 2: '2', 3: '3', 4: '4', 5: '5', 6: '6', 7: '7', 8: '8', 9: '9'} |
[링크 : https://blog.finxter.com/python-return-dictionary-from-function/]
enumerate() 는 내용과 인덱스를 같이 돌려주고 start 키워드를 이용해 시작 인덱스를 0이 아닌 것으로 설정이 가능하다.
>>> for entry in enumerate(['A', 'B', 'C']): ... print(entry) ... (0, 'A') (1, 'B') (2, 'C') |
[링크 : https://www.daleseo.com/python-enumerate/]
enumerate()와 유사하게 두개의 배열을 하나의 쌍으로 묶어주는 함수
>>> numbers = [1, 2, 3] >>> letters = ["A", "B", "C"] >>> for pair in zip(numbers, letters): ... print(pair) ... (1, 'A') (2, 'B') (3, 'C') |
'Programming > python(파이썬)' 카테고리의 다른 글
python matplotlib 설치 (0) | 2023.03.08 |
---|---|
python openCV / PIL 포맷 변경 (0) | 2022.04.12 |
python interactive mode (0) | 2022.03.15 |
python3 opencv2 checker board (0) | 2022.03.14 |
pdb (0) | 2022.03.14 |
변수타입이 뒤로 가는 걸 제외하면 문법은 그대로~
package main import "fmt" type Vertex struct { X int Y int } func main() { v := Vertex{1, 2} v.X = 4 fmt.Println(v.X) } |
'Programming > golang' 카테고리의 다른 글
go run ./ (2) | 2022.04.18 |
---|---|
golang module (0) | 2022.04.13 |
golang defer와 if (0) | 2022.04.11 |
golang a tour of go offline (0) | 2022.04.07 |
golang struct (0) | 2022.04.07 |
go는 c 처럼 if (조건문)로 쓸수도 있고 if 조건문 으로 괄호 생략하고 쓸 수 도 있다
다만 { } 는 if와 동일한 라인
} else { 는 무조건 동일 라인으로 해주어야 한다.
파이썬이 싫은 이유가 golang에도 동일하게 존재하게 되다니 ㅠㅠ
package main import "fmt" func main() { fmt.Println("counting") for i := 0; i < 10; i++ { if (i % 2 == 0) { defer fmt.Println(i) } else { fmt.Println(i) } } fmt.Println("done") } |
defer는 연기된 함수 호출이 쌓였다가 실행되는데 stack 이라 선입후출이다.
그런데 수정해서 아래와 같은 결과를 얻었는데.. 어떤 scope까지 쌓이다가 실행 되는걸까?
counting 1 3 5 7 9 done 8 6 4 2 0 |
[링크 : https://go-tour-ko.appspot.com/flowcontrol/13]
[링크 : https://www.callicoder.com/golang-control-flow/]
+
흐음.. 함수 단위에서 써야지 메인문에서 쓰긴 애매한 기능이군.
c와는 달리 garbage collector가 들어있어서 malloc-free 쌍은 필요 없을듯 하지만
그런식의 초기화, 삭제가 필요한 구조가 한 함수에 존재한다면(1회성)
초기화 하면서 삭제 함수를 defer 해두면 좀 편해질 것 같다.
특정 함수가 현재 함수가 끝나기 직전 실행하는 기능이다. |
'Programming > golang' 카테고리의 다른 글
golang module (0) | 2022.04.13 |
---|---|
golang 구조체 (0) | 2022.04.11 |
golang a tour of go offline (0) | 2022.04.07 |
golang struct (0) | 2022.04.07 |
golang pointer (0) | 2022.04.07 |