diff --git a/nvidia_deeplearningexamples_ssd.md b/nvidia_deeplearningexamples_ssd.md index 21aa566..790b5b9 100644 --- a/nvidia_deeplearningexamples_ssd.md +++ b/nvidia_deeplearningexamples_ssd.md @@ -20,52 +20,47 @@ demo-model-link: https://huggingface.co/spaces/pytorch/SSD ### Model Description -This SSD300 model is based on the -[SSD: Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325) paper, which -describes SSD as “a method for detecting objects in images using a single deep neural network". -The input size is fixed to 300x300. +SSD300 모델은 "단일 심층 신경망을 사용하여 이미지에서 물체를 감지하는 방법"으로 설명 하는 [SSD: Single Shot MultiBox Detector](https://arxiv.org/abs/1512.02325) 논문을 기반으로 합니다. 입력 크기는 300x300으로 고정되어 있습니다. -The main difference between this model and the one described in the paper is in the backbone. -Specifically, the VGG model is obsolete and is replaced by the ResNet-50 model. +이 모델과 논문에 설명된 모델의 큰 차이점은 백본(backbone)에 있습니다. 논문에서 사용한 VGG 모델은 더 이상 사용되지 않으며 ResNet-50 모델로 대체되었습니다. -From the -[Speed/accuracy trade-offs for modern convolutional object detectors](https://arxiv.org/abs/1611.10012) -paper, the following enhancements were made to the backbone: -* The conv5_x, avgpool, fc and softmax layers were removed from the original classification model. -* All strides in conv4_x are set to 1x1. +[Speed/accuracy trade-offs for modern convolutional object detectors](https://arxiv.org/abs/1611.10012) 논문에서 , 백본에 대해 다음과 같은 개선이 이루어졌습니다.: +* conv5_x, avgpool, fc 및 softmax 레이어는 기존의 분류 모델에서 제거되었습니다. +* conv4_x의 모든 strides는 1x1로 설정됩니다. + +백본 뒤에는 5개의 컨볼루션 레이어가 추가됩니다. 또한 컨볼루션 레이어 외에도 6개의 detection heads를 추가했습니다. The backbone is followed by 5 additional convolutional layers. In addition to the convolutional layers, we attached 6 detection heads: -* The first detection head is attached to the last conv4_x layer. -* The other five detection heads are attached to the corresponding 5 additional layers. +* 첫 번째 detection head는 마지막 conv4_x 레이어에 연결됩니다. +* 나머지 5개의 detection head는 추가되는 5개의 컨볼루션 레이어에 부착됩니다. -Detector heads are similar to the ones referenced in the paper, however, -they are enhanced by additional BatchNorm layers after each convolution. +Detector heads는 논문에서 언급된 것과 유사하지만, 각각의 컨볼루션 레이어 뒤에 BatchNorm 레이어를 추가함으로써 성능이 향상됩니다. ### Example -In the example below we will use the pretrained SSD model to detect objects in sample images and visualize the result. +아래 예에서는 사전에 학습된 SSD 모델을 사용하여 샘플 이미지에서 객체를 탐지하고 결과를 시각화합니다. -To run the example you need some extra python packages installed. These are needed for preprocessing images and visualization. +예제를 실행하려면 몇 가지 추가적인 파이썬 패키지가 설치되어 있어야 합니다. 이는 이미지 전처리 및 시각화에 필요합니다. ```bash pip install numpy scipy scikit-image matplotlib ``` -Load an SSD model pretrained on COCO dataset, as well as a set of utility methods for convenient and comprehensive formatting of input and output of the model. +COCO 데이터셋에 대해 사전에 학습된 SSD 모델과, 모델의 입력 및 출력에 대한 편리하고 포괄적인 형식 지정을 위한 유틸리티를 불러옵니다. ```python import torch ssd_model = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd') utils = torch.hub.load('NVIDIA/DeepLearningExamples:torchhub', 'nvidia_ssd_processing_utils') ``` -Now, prepare the loaded model for inference +추론을 위해 불러온 모델을 준비합니다. ```python ssd_model.to('cuda') ssd_model.eval() ``` -Prepare input images for object detection. -(Example links below correspond to first few test images from the COCO dataset, but you can also specify paths to your local images here) +객체 탐지를 위한 입력 이미지를 준비합니다. +(아래 예제 링크는 COCO 데이터셋의 처음 몇 개의 테스트 이미지에 해당하지만, 로컬 이미지에 대한 경로를 지정할 수도 있습니다.) ```python uris = [ 'http://images.cocodataset.org/val2017/000000397133.jpg', @@ -74,33 +69,32 @@ uris = [ ] ``` -Format the images to comply with the network input and convert them to tensor. +네트워크 입력에 맞게 이미지를 포맷하고 텐서로 변환합니다. ```python inputs = [utils.prepare_input(uri) for uri in uris] tensor = utils.prepare_tensor(inputs) ``` -Run the SSD network to perform object detection. +객체를 탐지하기 위해 SSD 네트워크를 실행합니다. ```python with torch.no_grad(): detections_batch = ssd_model(tensor) ``` -By default, raw output from SSD network per input image contains -8732 boxes with localization and class probability distribution. -Let's filter this output to only get reasonable detections (confidence>40%) in a more comprehensive format. +기본적으로 입력 이미지당 SSD 네트워크의 가공되기 이전의 출력에서 국소화 및 클래스 확률 분포가 있는 8732개의 상자가 포함됩니다. +보다 포괄적인 형식으로 합리적인 탐지(신뢰도>40%)만 얻도록 이 출력을 필터링해 보겠습니다. ```python results_per_input = utils.decode_results(detections_batch) best_results_per_input = [utils.pick_best(results, 0.40) for results in results_per_input] ``` -The model was trained on COCO dataset, which we need to access in order to translate class IDs into object names. -For the first time, downloading annotations may take a while. +이 모델은 COCO 데이터셋에 대해 학습되었고, 클래스 ID를 객체 이름으로 번역하기 위해 유틸리티에 접근합니다. +처음에 다운로드할 때는 시간이 걸릴 수 있습니다. ```python classes_to_labels = utils.get_coco_object_dictionary() ``` -Finally, let's visualize our detections +끝으로, 탐지한 결과를 시각화해 보겠습니다. ```python from matplotlib import pyplot as plt import matplotlib.patches as patches @@ -122,10 +116,7 @@ plt.show() ``` ### Details -For detailed information on model input and output, -training recipies, inference and performance visit: -[github](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Detection/SSD) -and/or [NGC](https://ngc.nvidia.com/catalog/resources/nvidia:ssd_for_pytorch) +모델 입력 및 출력, 학습 방법, 추론 및 성능 등에 대한 더 자세한 정보는 [github](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Detection/SSD) 및 [NGC](https://ngc.nvidia.com/catalog/resources/nvidia:ssd_for_pytorch)에서 볼 수 있습니다. ### References