DrawingProcess
๋“œํ”„ DrawingProcess
DrawingProcess
์ „์ฒด ๋ฐฉ๋ฌธ์ž
์˜ค๋Š˜
์–ด์ œ
ยซ   2025/06   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
  • ๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ (967)
    • Profile & Branding (25)
      • Career (18)
    • IT Trends (254)
      • Conference, Faire (Experien.. (31)
      • News (187)
      • Youtube (19)
      • TED (8)
      • Web Page (2)
      • IT: Etc... (6)
    • Contents (97)
      • Book (66)
      • Lecture (31)
    • Project Process (94)
      • Ideation (0)
      • Study Report (34)
      • Challenge & Award (22)
      • 1Day1Process (5)
      • Making (5)
      • KRC-FTC (Team TC(5031, 5048.. (10)
      • GCP (GlobalCitizenProject) (15)
    • Study: ComputerScience(CS) (72)
      • CS: Basic (9)
      • CS: Database(SQL) (5)
      • CS: Network (14)
      • CS: OperatingSystem (3)
      • CS: Linux (39)
      • CS: Etc... (2)
    • Study: Software(SW) (95)
      • SW: Language (29)
      • SW: Algorithms (1)
      • SW: DataStructure & DesignP.. (1)
      • SW: Opensource (15)
      • SW: Error Bug Fix (43)
      • SW: Etc... (6)
    • Study: Artificial Intellige.. (149)
      • AI: Research (1)
      • AI: 2D Vision(Det, Seg, Tra.. (35)
      • AI: 3D Vision (70)
      • AI: MultiModal (3)
      • AI: SLAM (0)
      • AI: Light Weight(LW) (3)
      • AI: Data Pipeline (7)
      • AI: Machine Learning(ML) (1)
    • Study: Robotics(Robot) (33)
      • Robot: ROS(Robot Operating .. (9)
      • Robot: Positioning (8)
      • Robot: Planning & Control (7)
    • Study: DeveloperTools(DevTo.. (83)
      • DevTool: Git (12)
      • DevTool: CMake (13)
      • DevTool: NoSQL(Elastic, Mon.. (25)
      • DevTool: Container (17)
      • DevTool: IDE (11)
      • DevTool: CloudComputing (4)
    • ์ธ์ƒ์„ ์‚ด๋ฉด์„œ (64)
      • ๋‚˜์˜ ์ทจ๋ฏธ๋“ค (7)
      • ๋‚˜์˜ ์ƒ๊ฐ๋“ค (42)
      • ์—ฌํ–‰์„ ๋– ๋‚˜์ž~ (10)
      • ๋ถ„๊ธฐ๋ณ„ ํšŒ๊ณ  (5)

๊ฐœ๋ฐœ์ž ๋ช…์–ธ

โ€œ ๋งค์ฃผ ๋ชฉ์š”์ผ๋งˆ๋‹ค ๋‹น์‹ ์ด ํ•ญ์ƒ ํ•˜๋˜๋Œ€๋กœ ์‹ ๋ฐœ๋ˆ์„ ๋ฌถ์œผ๋ฉด ์‹ ๋ฐœ์ด ํญ๋ฐœํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด๋ผ.
์ปดํ“จํ„ฐ๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ์ด๋Ÿฐ ์ผ์ด ํ•ญ์ƒ ์ผ์–ด๋‚˜๋Š”๋ฐ๋„ ์•„๋ฌด๋„ ๋ถˆํ‰ํ•  ์ƒ๊ฐ์„ ์•ˆ ํ•œ๋‹ค. โ€

- Jef Raskin

๋งฅ์˜ ์•„๋ฒ„์ง€ - ์• ํ”Œ์ปดํ“จํ„ฐ์˜ ๋งคํ‚จํ† ์‹œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ฃผ๋„

์ธ๊ธฐ ๊ธ€

์ตœ๊ทผ ๊ธ€

์ตœ๊ทผ ๋Œ“๊ธ€

ํ‹ฐ์Šคํ† ๋ฆฌ

hELLO ยท Designed By ์ •์ƒ์šฐ.
DrawingProcess

๋“œํ”„ DrawingProcess

Study: Artificial Intelligence(AI)/AI: Data Pipeline

[Dataset] Object Detection/Segmentation Open Dataset: COCO Dataset

2024. 5. 9. 09:27
๋ฐ˜์‘ํ˜•
๐Ÿ’ก ๋ณธ ๋ฌธ์„œ๋Š” '[Dataset] Object Detection/Segmentation Open Dataset: COCO Dataset '์— ๋Œ€ํ•ด ์ •๋ฆฌํ•ด๋†“์€ ๊ธ€์ž…๋‹ˆ๋‹ค.
Object Detection/Segmentation Task๋ฅผ ํ•œ๋‹ค๊ณ  ํ•˜๋ฉด ๊ฐ€์žฅ ๊ฐ€๋ณธ์ ์œผ๋กœ ์•Œ์•„์•ผ ํ•˜๋Š” ๋ฐ์ดํ„ฐ์…‹์ธ COCO ๋ฐ์ดํ„ฐ์…‹์— ๋Œ€ํ•ด ํ™œ์šฉ๋ฐฉ๋ฒ•๊นŒ์ง€ ์ •๋ฆฌํ•˜์˜€์œผ๋‹ˆ ์ฐธ๊ณ ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.

1. COCO ๋ฐ์ดํ„ฐ์…‹

COCO ๋ฐ์ดํ„ฐ์…‹ ๊ตฌ์กฐ

COCO ๋ฐ์ดํ„ฐ์…‹์˜ annotation์€ json ํ˜•ํƒœ๋กœ ๋˜์–ด ์žˆ์œผ๋ฉฐ, ๊ธฐ๋ณธ์ ์ธ ๊ตฌ์กฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ํ•„์ˆ˜์ ์ธ ํ‚ค๋ฅผ ๊ฐ€์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

'images': [
    {
        'file_name': 'COCO_val2014_000000001268.jpg',
        'height': 427,
        'width': 640,
        'id': 1268
    },
    ...
],

'annotations': [
    {
        'segmentation': [[192.81,
            247.09,
            ...
            219.03,
            249.06]],  # if you have mask labels
        'area': 1035.749,
        'iscrowd': 0,
        'image_id': 1268,
        'bbox': [192.81, 224.8, 74.73, 33.43],
        'category_id': 16,
        'id': 42986
    },
    ...
],

'categories': [
    {'id': 0, 'name': 'car'},
 ]

There are three necessary keys in the json file:

  • images: contains a list of images with their informations like file_name, height, width, and id.
  • annotations: contains the list of instance annotations.
  • categories: contains the list of categories names and their ID.

After the data pre-processing, there are two steps for users to train the customized new dataset with existing format (e.g. COCO format):

  1. Modify the config file for using the customized dataset.
  2. Check the annotations of the customized dataset.

Here we give an example to show the above two steps, which uses a customized dataset of 5 classes with COCO format to train an existing Cascade MaskRCNN R50 FPN detector.

2. COCO ๋ฐ์ดํ„ฐ์…‹ ๋‹ค์šด๋กœ๋“œ

๋ณดํ†ต, coco dataset์€ ์•„๋ž˜ ๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ๊ฐ€ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค๋งŒ, ์•„๋ฌด๋ฆฌ ๋ฐ์ดํ„ฐ์…‹์„ ํด๋ฆญํ•ด๋„ ๋‹ค์šด๋กœ๋“œ๊ฐ€ ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

  • coco dataset download : https://cocodataset.org/#download

wget์„ ํ†ตํ•ด ๋‹ค์šด๋กœ๋“œ ํ•˜๋ คํ•ด๋„ ๋งํฌ๊ฐ€ ๋ณ€๊ฒฝ๋˜์—ˆ๋Š”์ง€ ๋‹ค์šด๋กœ๋“œ ๋˜์ง€ ์•Š์•˜๊ณ , ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฒฝ๋กœ๊ฐ€ ๋ณ€๊ฒฝ๋œ ๊ฒƒ์„ ์ฐพ์•˜์Šต๋‹ˆ๋‹ค.

# images
wget http://images.cocodataset.org/zips/train2017.zip   # train dataset
wget http://images.cocodataset.org/zips/val2017.zip     # validation dataset
wget http://images.cocodataset.org/zips/test2017.zip    # test dataset
wget http://images.cocodataset.org/zips/unlabeled2017.zip

# annotations
wget http://images.cocodataset.org/annotations/annotations_trainval2017.zip
wget http://images.cocodataset.org/annotations/stuff_annotations_trainval2017.zip
wget http://images.cocodataset.org/annotations/image_info_test2017.zip
wget http://images.cocodataset.org/annotations/image_info_unlabeled2017.zip

์œ„ ๊ฒฝ๋กœ๋“ค์—์„œ ์ด๋ฏธ์ง€๋‚˜ annotation ๋ชจ๋‘ train2017.zip ๋ถ€๋ถ„์„ ์›ํ•˜๋Š” dataset์œผ๋กœ ๋ณ€๊ฒฝ(ex. train2015)ํ•˜์—ฌ ๋‹ค์šด๋กœ๋“œ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€๋กœ annotations_trainval2017.zip ํŒŒ์ผ์„ ๋‹ค์šด๋ฐ›๊ณ  unzip์„ ํ•˜๊ฒŒ ๋˜๋ฉด annotation ํŒŒ์ผ๋“ค์„ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

3. COCO API ์‚ฌ์šฉํ•˜๊ธฐ

๋‹ค์šด๋ฐ›์€ coco dataset์€ api๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ python์—์„œ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋ฏธ์ง€๋ฅผ ์‹œ๊ฐํ™” ํ•˜๊ณ  annotation ์ •๋ณด๊นŒ์ง€ ์‹œ๊ฐํ™” ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

1) coco api ์ดˆ๊ธฐํ™”

%matplotlib inline
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import pylab
pylab.rcParams['figure.figsize'] = (8.0, 10.0)

dataDir='..'
dataType='val2017'

# initialize COCO api for person keypoints annotations
annFile = '{}/annotations/person_keypoints_{}.json'.format(dataDir,dataType)
coco=COCO(annFile)

2) COCO categories and supercategories ์ถœ๋ ฅ ํ•ด ๋ณด๊ธฐ

cats = coco.loadCats(coco.getCatIds())
nms=[cat['name'] for cat in cats]
print('COCO categories: \n{}\n'.format(' '.join(nms)))

nms = set([cat['supercategory'] for cat in cats])
print('COCO supercategories: \n{}'.format(' '.join(nms)))

3) ์ด๋ฏธ์ง€ ์‹œ๊ฐํ™”

# get all images containing given categories, select one at random
catIds = coco.getCatIds(catNms=['person','dog','skateboard']);
imgIds = coco.getImgIds(catIds=catIds );
imgIds = coco.getImgIds(imgIds = [324158])
img = coco.loadImgs(imgIds[np.random.randint(0,len(imgIds))])[0]

# load and display image
# I = io.imread('%s/images/%s/%s'%(dataDir,dataType,img['file_name']))
# use url to load image
I = io.imread(img['coco_url'])
plt.axis('off')
plt.imshow(I)
plt.show()

 

4) annotation ์‹œ๊ฐํ™”

# load and display keypoints annotations
plt.imshow(I); plt.axis('off')
ax = plt.gca()
annIds = coco_kps.getAnnIds(imgIds=img['id'], catIds=catIds, iscrowd=None)
anns = coco_kps.loadAnns(annIds)
coco_kps.showAnns(anns)

์ฐธ๊ณ 

  • [Github] coco API : https://github.com/cocodataset/cocoapi
  • [Github] coco API Demo: https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoDemo.ipynb
  • [mmdetection] Customize Datasets: https://mmdetection.readthedocs.io/en/v2.11.0/tutorials/customize_dataset.html  
๋ฐ˜์‘ํ˜•
์ €์ž‘์žํ‘œ์‹œ ๋น„์˜๋ฆฌ ๋ณ€๊ฒฝ๊ธˆ์ง€ (์ƒˆ์ฐฝ์—ด๋ฆผ)

'Study: Artificial Intelligence(AI) > AI: Data Pipeline' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Data] Python ์ด๋ฏธ์ง€ ์—ฌ๋ฐฑ ์ง€์šฐ๊ธฐ (numpy, mask, ...)  (0) 2024.04.30
[Data] Segmentation ๋ฐ์ดํ„ฐ ์••์ถ• ์•Œ๊ณ ๋ฆฌ์ฆ˜: Run Length Encoding(RLE) - coco mask to rle์™€ rle to mask ๊ฒ€์ฆ๊นŒ์ง€  (0) 2024.02.28
[Deploy] ONNX: ๋‹ค๋ฅธ DNN ํ”„๋ ˆ์ž„์›Œํฌ ๊ฐ„ ๋ชจ๋ธ ํ˜ธํ™˜ ํฌ๋ฉง(pytorch, tensorflow, TensorRT, ...)  (1) 2024.02.14
[Dataset] Autonomous Driving Open Dataset: nuScenes Dataset(+ nuImages, nuPlan, Occupancy, nuReality)  (1) 2023.12.26
[Dataset] Autonomous Driving Open Dataset: KITTI Dataset (Visual Odometry/SLAM, 3D Object Detection)  (1) 2023.12.26
    'Study: Artificial Intelligence(AI)/AI: Data Pipeline' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€
    • [Data] Python ์ด๋ฏธ์ง€ ์—ฌ๋ฐฑ ์ง€์šฐ๊ธฐ (numpy, mask, ...)
    • [Data] Segmentation ๋ฐ์ดํ„ฐ ์••์ถ• ์•Œ๊ณ ๋ฆฌ์ฆ˜: Run Length Encoding(RLE) - coco mask to rle์™€ rle to mask ๊ฒ€์ฆ๊นŒ์ง€
    • [Deploy] ONNX: ๋‹ค๋ฅธ DNN ํ”„๋ ˆ์ž„์›Œํฌ ๊ฐ„ ๋ชจ๋ธ ํ˜ธํ™˜ ํฌ๋ฉง(pytorch, tensorflow, TensorRT, ...)
    • [Dataset] Autonomous Driving Open Dataset: nuScenes Dataset(+ nuImages, nuPlan, Occupancy, nuReality)
    DrawingProcess
    DrawingProcess
    ๊ณผ์ •์„ ๊ทธ๋ฆฌ์ž!

    ํ‹ฐ์Šคํ† ๋ฆฌํˆด๋ฐ”