본문 바로가기

딥러닝프로젝트/pose_estimation

DeeplabCut 사용하는법

진행기간:19년 11월 16~20일

 

 

안녕하세요

 

이전에 제가 DeepLabcut, Leap 프레임워크를 소개하는 글을 올렸습니다.

 

 

이번에는 Deeplabcut라이브러리를 어떻게 사용하는지 알아 보도록 하겠습니다.

 

https://github.com/AlexEMG/DeepLabCut/blob/master/conda-environments/README.md

 

위의 github를 clone 해주도록 합니다.(우선 로컬에서 진행합니다.)

우선 readMd에 나와있는대로 , 가상환경 하나를 다운받아줍니다.

Creating Project

Ln[0] : activate dlc-windowsCPU

Ln[1] : Import deeplabcut

Ln[2] : Deeplabcut.create_new_project(이름 , 훈련하는사람,비디오경로)

Ln[3] : path_config = ‘C:\\Users\\Woong\\MyAnimal-Deeperent-2019-11-13\\config.yaml

Ex): Deeplabcut.create_new_project(‘MyAnimal , ‘Deeperent‘,’Path’)

 

Edit Config File

편집기 없으면 메모장으로 열어도 OK.

 

Select Data

Ln[4] : deeplabcut.extract_frames(path_config,’automatic’,’kmeans’);

 

Labeling Frame

 ※이 labeling_frame을 여는것이 GoogleColab상에선 불가능했기 때문에 , Local에서 해주어야합니다.

※JupyterNotebook을 사용할 경우 Computing Power가 충분하지않으면 다운되기 때문에 cmd를 통해 python을 실행시킨후 사용하는것이 좋습니다.

 

Google Colab에 업로드

로컬에서 만들어진 project를 구글 드라이브에 업로드해줍니다.

※path들은 GoogleDrive의 경로로 바꿔주셔야합니다.

 

Google Colab에서 훈련

Ln[5] : deeplabcut.create_training_dataset(path_config_file)

Ln[6] : deeplabcut.train_network(path_config_file)

Ln[7] : deeplabcut.evaluate_network(path_config_file)

Ln[8] : deeplabcut.analyze_vidoes(path_config_file, video_file_path)

Ln[9] : deeplabcut.create_labeled_video(path_config_file,videofile_path)

 

GUI

deeplabcut.launch_dic()

라는 명령어를 이용하면 위의  과정을 GUI로 편하게 할 수 있습니다.

※훈련은 Gpu가없다면 코랩에서 진행하도록 하자

 

 

tv.kakao.com/v/403801496

위 영상은 관절을 딴것을 학습시킨 결과입니다.

 

 

※팀원들이 재미없다고 해서 이 프로젝트는 여기까지 하고 마무리 했습니다.언젠가 기회가 된다면 강아지에게 Pose_estimation을 제대로 해보고싶네요

'딥러닝프로젝트 > pose_estimation' 카테고리의 다른 글

DeepLabCut, Leap  (0) 2020.07.18