본문 바로가기

팀프로젝트 - TailsRoute

TEAM Project (11.04) - dog 행동 데이터셋 다운, 확인, Google Colab 활용

참고한 블로그
https://lapina.tistory.com/69

 

데이터셋 다운로드

AIHUB에서 제공한 반려동물 구분을 위한 동물 영상 에서 Innoix Agent 설치 후 다운

파일 병합 준비

1. WSL 설치 (Windows 사용)

wsl --install

-> Ubuntu(리눅스 기반의 운영 체제) 설치

 

2. Ubuntu(WSL 터미널)에서 다운로드 한 데이터셋 파일이 저장된 경로로 이동

cd /mnt/c/Users/juns0/Downloads

파일 병합 명령어 실행

find "폴더경로" -name "파일명.zip.part*" -print0 | sort -zt'.' -k2V | xargs -0 cat > "파일명.zip"


find . -name "dataset.zip.part*" -print0 | sort -zt'.' -k2V | xargs -0 cat > "dataset.zip"

 

 


 

경로 표시

dog_behavior_analysis/
  ├── scripts/
  │    ├── animal_classification/  # 동물 인식 관련 스크립트
  │    │     ├── preprocess.py
  │    │     ├── train_model.py
  │    │     ├── test_model.py
  │    ├── behavior_analysis/      # 행동 분석 관련 스크립트
  │    │     ├── preprocess.py
  │    │     ├── train_model.py
  │    │     ├── test_model.py
  ├── train/
  │    ├── cats/
  │    ├── dogs/
  │    ├── sit/
  │        ├── labeling_sit/
  │        └── frame_sit/
  ├── validation/
  │    ├── cats/
  │    ├── dogs/
  │    ├── sit/
  │        ├── labeling_sit/
  │        └── frame_sit/

JSON 파일 가져옴

"metadata": {
        "seq": 403,
        "species": "DOG",
        "action": "앉기",
        "location": "야외",
        "height": 1920,
        "width": 1080,
        "duration": 18.833333,
        "animal": {
            "breed": "웰시 코기 (펨브록)",
            "gender": "FEMALE",
            "age": 3,
            "neuter": "Y"
        },
        "owner": {
            "pain": "N",
            "disease": "Y",
            "emotion": "행복/즐거움",
            "situation": "산책 준비 또는 산책중일 때",
            "animalCount": 1
        },
        "inspect": {
            "action": "앉기",
            "painDisease": "N",
            "abnormalAction": "N",
            "emotion": "편안/안정"
        },
        "weather": "맑음"
    },
    
     "annotations": [
        {
            "frame_number": 0,
            "frame_url": "https://dashboard.datamaker.io/media/task/raw_data/94460e5f-01d9-46a9-838e-95cc733cbbd8.jpg",
            "timestamp": 0,
            "keypoints": {
                "1": {
                    "x": 345,
                    "y": 860
                },
                "2": {
                    "x": 477,
                    "y": 537
                },
                "3": {
                    "x": 511,
                    "y": 859
                },
                "4": null,
                "5": null,
                "6": {
                    "x": 424,
                    "y": 1088
                },
                .
                .
                .

위 처럼 코드가 작성되어있는 것을 확인할 수 있었고, 관절 좌표 데이터도 포함되어 있는 것을 확인

 


 

Google Colab 활용

학습시 모델의 용량 문제로 인하여 GPU 환경에서 실행 / 모델의 훈련 속도도 크게 높일 수 있음
GPU는 대량의 데이터와 복잡한 연산을 병렬 처리하는 데 유리

Colab 상단 메뉴에서 런타임 -> 런타임 유형 변경 / 하드웨어 가속기에서 GPU 선택 후 저장 클릭