Hakureirm
commited on
Commit
•
9342c6e
0
Parent(s):
Initial commit after resetting Git history
Browse files- .gitattributes +2 -0
- Dockerfile +34 -0
- app.py +210 -0
- kunin-dlc-240814/.DS_Store +0 -0
- kunin-dlc-240814/config.yaml +92 -0
- kunin-dlc-240814/dlc-models/.DS_Store +0 -0
- kunin-dlc-240814/dlc-models/iteration-0/.DS_Store +0 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/.DS_Store +0 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/test/inference_cfg.yaml +17 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/test/pose_cfg.yaml +197 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/pose_cfg.yaml +218 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.data-00000-of-00001 +3 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.index +0 -0
- kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.meta +3 -0
- kunin-dlc-240814/labeled-data/.DS_Store +0 -0
- kunin-dlc-240814/videos/.DS_Store +0 -0
.gitattributes
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
2 |
+
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.meta filter=lfs diff=lfs merge=lfs -text
|
Dockerfile
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 使用 TensorFlow 官方的 GPU 镜像,2.10.0-gpu
|
2 |
+
FROM tensorflow/tensorflow:2.10.0-gpu
|
3 |
+
|
4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
5 |
+
|
6 |
+
# 替换为BFSU的镜像源并安装系统依赖
|
7 |
+
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.bfsu.edu.cn/ubuntu/|g' /etc/apt/sources.list && \
|
8 |
+
apt-get update -yy && \
|
9 |
+
apt-get install -yy --no-install-recommends ffmpeg libsm6 libxext6 && \
|
10 |
+
rm -rf /var/lib/apt/lists/* && \
|
11 |
+
apt-get clean
|
12 |
+
|
13 |
+
# 设置pip使用BFSU的PyPI镜像源并安装Python库和DeepLabCut
|
14 |
+
RUN pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple && \
|
15 |
+
pip install "deeplabcut[tf]" numpy==1.24.0 decorator==4.4.2 fastapi uvicorn && \
|
16 |
+
pip list
|
17 |
+
|
18 |
+
# 修复 TensorFlow 与 protobuf 的兼容性问题
|
19 |
+
RUN pip install protobuf==3.20.1
|
20 |
+
|
21 |
+
# 修复容器权限问题,确保 DeepLabCut 可以正确运行
|
22 |
+
RUN chmod a+rwx -R /usr/local/lib/python3.*/dist-packages/deeplabcut/pose_estimation_tensorflow/models/pretrained
|
23 |
+
|
24 |
+
# 复制 kunin-dlc-240814 目录到容器中
|
25 |
+
COPY kunin-dlc-240814 /app/kunin-dlc-240814
|
26 |
+
|
27 |
+
# 复制应用代码
|
28 |
+
COPY app.py /app/app.py
|
29 |
+
|
30 |
+
# 设置工作目录
|
31 |
+
WORKDIR /app
|
32 |
+
|
33 |
+
# 运行服务
|
34 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
|
app.py
ADDED
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import logging
|
2 |
+
import asyncio
|
3 |
+
from fastapi import FastAPI, HTTPException, Request
|
4 |
+
from fastapi.responses import FileResponse
|
5 |
+
from fastapi.middleware.cors import CORSMiddleware
|
6 |
+
import deeplabcut as dlc
|
7 |
+
import os
|
8 |
+
import requests
|
9 |
+
from typing import Dict
|
10 |
+
import threading
|
11 |
+
|
12 |
+
# 实例化FastAPI应用
|
13 |
+
app = FastAPI()
|
14 |
+
|
15 |
+
# 允许任何来源的CORS请求
|
16 |
+
app.add_middleware(
|
17 |
+
CORSMiddleware,
|
18 |
+
allow_origins=["*"], # 允许任何来源
|
19 |
+
allow_credentials=True,
|
20 |
+
allow_methods=["*"], # 允许所有方法
|
21 |
+
allow_headers=["*"], # 允许所有头部
|
22 |
+
)
|
23 |
+
|
24 |
+
# 配置文件路径
|
25 |
+
project_path = "/app/kunin-dlc-240814"
|
26 |
+
config_path = os.path.join(project_path, "config.yaml")
|
27 |
+
|
28 |
+
# 设置日志记录格式
|
29 |
+
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
30 |
+
|
31 |
+
# 创建线程锁
|
32 |
+
lock = threading.Lock()
|
33 |
+
|
34 |
+
# 用于跟踪已下载的文件
|
35 |
+
downloaded_files = {}
|
36 |
+
|
37 |
+
@app.post("/analyze")
|
38 |
+
async def analyze_video(request: Request):
|
39 |
+
logging.info("Received request for video analysis")
|
40 |
+
|
41 |
+
# 获取锁,确保只有一个分析任务在进行
|
42 |
+
with lock:
|
43 |
+
try:
|
44 |
+
# 在开始处理前清空工作目录
|
45 |
+
clear_working_directory("/app/working")
|
46 |
+
|
47 |
+
data: Dict = await request.json()
|
48 |
+
logging.info(f"Request data: {data}")
|
49 |
+
except Exception as e:
|
50 |
+
logging.error(f"Failed to parse JSON: {str(e)}")
|
51 |
+
raise HTTPException(status_code=400, detail=f"Invalid JSON: {str(e)}")
|
52 |
+
|
53 |
+
if 'videoUrl' not in data or 'videoOssId' not in data:
|
54 |
+
logging.error("Missing videoUrl or videoOssId in request")
|
55 |
+
raise HTTPException(status_code=400, detail="videoUrl and videoOssId are required")
|
56 |
+
|
57 |
+
video_url = data['videoUrl']
|
58 |
+
video_oss_id = data['videoOssId']
|
59 |
+
|
60 |
+
try:
|
61 |
+
video_path = download_video(video_url, video_oss_id)
|
62 |
+
logging.info(f"Downloaded video to: {video_path}")
|
63 |
+
except Exception as e:
|
64 |
+
logging.error(f"Error downloading video: {str(e)}")
|
65 |
+
raise HTTPException(status_code=500, detail=f"Error downloading video: {str(e)}")
|
66 |
+
|
67 |
+
try:
|
68 |
+
# 执行推理
|
69 |
+
logging.info(f"Starting analysis for video: {video_path}")
|
70 |
+
dlc.analyze_videos(config_path, [video_path], shuffle=0, videotype="mp4", auto_track=True)
|
71 |
+
logging.info("Video analysis completed")
|
72 |
+
|
73 |
+
# 过滤预测结果
|
74 |
+
logging.info(f"Filtering predictions for video: {video_path}")
|
75 |
+
dlc.filterpredictions(config_path, [video_path], shuffle=0, videotype='mp4')
|
76 |
+
logging.info("Predictions filtered")
|
77 |
+
|
78 |
+
# 创建标注视频
|
79 |
+
logging.info(f"Creating labeled video for: {video_path}")
|
80 |
+
dlc.create_labeled_video(
|
81 |
+
config_path,
|
82 |
+
[video_path],
|
83 |
+
videotype='mp4',
|
84 |
+
shuffle=0,
|
85 |
+
color_by="individual",
|
86 |
+
keypoints_only=False,
|
87 |
+
draw_skeleton=True,
|
88 |
+
filtered=True,
|
89 |
+
)
|
90 |
+
logging.info("Labeled video created")
|
91 |
+
|
92 |
+
# 查找并重命名输出文件
|
93 |
+
labeled_video_path, h5_file_path = find_and_rename_output_files(video_path)
|
94 |
+
if not labeled_video_path or not h5_file_path:
|
95 |
+
logging.error("Output files missing after analysis")
|
96 |
+
raise HTTPException(status_code=500, detail="Analysis completed, but output files are missing.")
|
97 |
+
|
98 |
+
# 初始化文件下载状态
|
99 |
+
downloaded_files[os.path.basename(labeled_video_path)] = False
|
100 |
+
downloaded_files[os.path.basename(h5_file_path)] = False
|
101 |
+
|
102 |
+
except Exception as e:
|
103 |
+
logging.error(f"Error during video analysis: {str(e)}")
|
104 |
+
raise HTTPException(status_code=500, detail=f"Error during video analysis: {str(e)}")
|
105 |
+
|
106 |
+
response_data = {
|
107 |
+
"videoOssId": video_oss_id,
|
108 |
+
"labeled_video": f"/post_download/{os.path.basename(labeled_video_path)}",
|
109 |
+
"h5_file": f"/post_download/{os.path.basename(h5_file_path)}"
|
110 |
+
}
|
111 |
+
|
112 |
+
logging.info("Returning response data")
|
113 |
+
return response_data
|
114 |
+
|
115 |
+
@app.post("/post_download/{filename}")
|
116 |
+
async def post_download_file(filename: str):
|
117 |
+
file_path = os.path.join("/app/working", filename)
|
118 |
+
if os.path.exists(file_path):
|
119 |
+
# 标记文件已被下载
|
120 |
+
downloaded_files[filename] = True
|
121 |
+
logging.info(f"Serving file: {file_path}")
|
122 |
+
return FileResponse(path=file_path, media_type='application/octet-stream', filename=filename)
|
123 |
+
else:
|
124 |
+
raise HTTPException(status_code=404, detail="File not found")
|
125 |
+
|
126 |
+
async def wait_for_files_to_be_downloaded(files: list):
|
127 |
+
"""等待文件被访问和下载后删除"""
|
128 |
+
try:
|
129 |
+
while any(not downloaded_files.get(os.path.basename(file), False) for file in files):
|
130 |
+
logging.info(f"Waiting for files to be downloaded: {files}")
|
131 |
+
await asyncio.sleep(5)
|
132 |
+
logging.info("All files have been downloaded, deleting them...")
|
133 |
+
for file in files:
|
134 |
+
if os.path.exists(file):
|
135 |
+
os.remove(file)
|
136 |
+
logging.info(f"Deleted file: {file}")
|
137 |
+
logging.info("All files have been deleted.")
|
138 |
+
except Exception as e:
|
139 |
+
logging.error(f"Failed to wait for files: {str(e)}")
|
140 |
+
|
141 |
+
def find_and_rename_output_files(video_path: str):
|
142 |
+
"""查找并重命名生成的标注视频和H5文件"""
|
143 |
+
working_directory = "/app/working"
|
144 |
+
base_name = os.path.splitext(os.path.basename(video_path))[0]
|
145 |
+
|
146 |
+
labeled_video = None
|
147 |
+
h5_file = None
|
148 |
+
|
149 |
+
for file in os.listdir(working_directory):
|
150 |
+
if file.endswith("_id_labeled.mp4"):
|
151 |
+
labeled_video = os.path.join(working_directory, file)
|
152 |
+
new_labeled_video = os.path.join(working_directory, f"{base_name}_labeled.mp4")
|
153 |
+
os.rename(labeled_video, new_labeled_video)
|
154 |
+
labeled_video = new_labeled_video
|
155 |
+
logging.info(f"Renamed labeled video to: {labeled_video}")
|
156 |
+
elif file.endswith("_filtered.h5"):
|
157 |
+
h5_file = os.path.join(working_directory, file)
|
158 |
+
new_h5_file = os.path.join(working_directory, f"{base_name}.h5")
|
159 |
+
os.rename(h5_file, new_h5_file)
|
160 |
+
h5_file = new_h5_file
|
161 |
+
logging.info(f"Renamed H5 file to: {h5_file}")
|
162 |
+
|
163 |
+
logging.info(f"Files in working directory after video processing: {os.listdir(working_directory)}")
|
164 |
+
return labeled_video, h5_file
|
165 |
+
|
166 |
+
def download_video(url: str, video_oss_id: str) -> str:
|
167 |
+
working_directory = "/app/working"
|
168 |
+
|
169 |
+
try:
|
170 |
+
# 确保目标目录存在
|
171 |
+
if not os.path.exists(working_directory):
|
172 |
+
os.makedirs(working_directory)
|
173 |
+
|
174 |
+
# 使用video_oss_id作为文件名,避免命名冲突
|
175 |
+
local_filename = os.path.join(working_directory, f"{video_oss_id}.mp4")
|
176 |
+
|
177 |
+
# 下载视频并处理可能的连接错误
|
178 |
+
logging.info(f"Downloading video from URL: {url}")
|
179 |
+
with requests.get(url, stream=True, timeout=60) as r:
|
180 |
+
r.raise_for_status()
|
181 |
+
with open(local_filename, 'wb') as f:
|
182 |
+
for chunk in r.iter_content(chunk_size=8192):
|
183 |
+
if chunk: # 过滤掉保持连接的空块
|
184 |
+
f.write(chunk)
|
185 |
+
logging.info(f"Video downloaded to: {local_filename}")
|
186 |
+
return local_filename
|
187 |
+
|
188 |
+
except requests.exceptions.RequestException as e:
|
189 |
+
logging.error(f"Failed to download video: {str(e)}")
|
190 |
+
raise HTTPException(status_code=500, detail=f"Failed to download video: {str(e)}")
|
191 |
+
except Exception as e:
|
192 |
+
logging.error(f"Unexpected error: {str(e)}")
|
193 |
+
raise HTTPException(status_code=500, detail=f"Unexpected error: {str(e)}")
|
194 |
+
|
195 |
+
def clear_working_directory(directory: str):
|
196 |
+
"""清空工作目录中的所有文件"""
|
197 |
+
try:
|
198 |
+
for filename in os.listdir(directory):
|
199 |
+
file_path = os.path.join(directory, filename)
|
200 |
+
if os.path.isfile(file_path) or os.path.islink(file_path):
|
201 |
+
os.unlink(file_path)
|
202 |
+
elif os.path.isdir(file_path):
|
203 |
+
os.rmdir(file_path)
|
204 |
+
logging.info(f"Cleared all files in directory: {directory}")
|
205 |
+
except Exception as e:
|
206 |
+
logging.error(f"Failed to clear directory {directory}: {str(e)}")
|
207 |
+
|
208 |
+
if __name__ == "__main__":
|
209 |
+
import uvicorn
|
210 |
+
uvicorn.run(app, host="0.0.0.0", port=8080)
|
kunin-dlc-240814/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
kunin-dlc-240814/config.yaml
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Project definitions (do not edit)
|
2 |
+
Task: demo
|
3 |
+
scorer: me
|
4 |
+
date: Aug14
|
5 |
+
multianimalproject: true
|
6 |
+
identity:
|
7 |
+
|
8 |
+
# Project path (change when moving around)
|
9 |
+
project_path: /app/kunin-dlc-240814
|
10 |
+
|
11 |
+
# Annotation data set configuration (and individual video cropping parameters)
|
12 |
+
video_sets:
|
13 |
+
/Users/placeholder.mp4:
|
14 |
+
crop: 0, 400, 0, 400
|
15 |
+
individuals:
|
16 |
+
- mus1
|
17 |
+
uniquebodyparts: []
|
18 |
+
multianimalbodyparts:
|
19 |
+
- snout
|
20 |
+
- leftear
|
21 |
+
- rightear
|
22 |
+
- shoulder
|
23 |
+
- spine1
|
24 |
+
- spine2
|
25 |
+
- spine3
|
26 |
+
- spine4
|
27 |
+
- tailbase
|
28 |
+
- tail1
|
29 |
+
- tail2
|
30 |
+
- tailend
|
31 |
+
bodyparts:
|
32 |
+
- snout
|
33 |
+
- leftear
|
34 |
+
- rightear
|
35 |
+
- shoulder
|
36 |
+
- spine1
|
37 |
+
- spine2
|
38 |
+
- spine3
|
39 |
+
- spine4
|
40 |
+
- tailbase
|
41 |
+
- tail1
|
42 |
+
- tail2
|
43 |
+
- tailend
|
44 |
+
|
45 |
+
# Fraction of video to start/stop when extracting frames for labeling/refinement
|
46 |
+
|
47 |
+
# Fraction of video to start/stop when extracting frames for labeling/refinement
|
48 |
+
start: 0
|
49 |
+
stop: 1
|
50 |
+
numframes2pick: 16
|
51 |
+
|
52 |
+
# Plotting configuration
|
53 |
+
skeleton:
|
54 |
+
- - snout
|
55 |
+
- leftear
|
56 |
+
- - snout
|
57 |
+
- rightear
|
58 |
+
- - snout
|
59 |
+
- tailbase
|
60 |
+
|
61 |
+
|
62 |
+
skeleton_color: cyan
|
63 |
+
pcutoff: 0.01
|
64 |
+
dotsize: 3
|
65 |
+
alphavalue: 0.7
|
66 |
+
colormap: spring
|
67 |
+
|
68 |
+
# Training,Evaluation and Analysis configuration
|
69 |
+
TrainingFraction:
|
70 |
+
- 0.95
|
71 |
+
iteration: 0
|
72 |
+
default_net_type: resnet_50
|
73 |
+
default_augmenter: default
|
74 |
+
default_track_method: ellipse
|
75 |
+
snapshotindex: -1
|
76 |
+
batch_size: 8
|
77 |
+
|
78 |
+
# Cropping Parameters (for analysis and outlier frame detection)
|
79 |
+
cropping: false
|
80 |
+
#if cropping is true for analysis, then set the values here:
|
81 |
+
x1: 0
|
82 |
+
x2: 640
|
83 |
+
y1: 277
|
84 |
+
y2: 624
|
85 |
+
|
86 |
+
# Refinement configuration (parameters from annotation dataset configuration also relevant in this stage)
|
87 |
+
corner2move2:
|
88 |
+
- 50
|
89 |
+
- 50
|
90 |
+
move2corner: true
|
91 |
+
croppedtraining: true
|
92 |
+
resnet: 50
|
kunin-dlc-240814/dlc-models/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
kunin-dlc-240814/dlc-models/iteration-0/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/test/inference_cfg.yaml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
addlikelihoods: 0.15
|
2 |
+
averagescore: 0.1
|
3 |
+
boundingboxslack: 0
|
4 |
+
detectionthresholdsquare: 0.1
|
5 |
+
distnormalization: 1000
|
6 |
+
distnormalizationLOWER: 0
|
7 |
+
iou_threshold: 0.6
|
8 |
+
lowerbound_factor: 0.5
|
9 |
+
max_age: 1
|
10 |
+
method: m1
|
11 |
+
min_hits: 1
|
12 |
+
minimalnumberofconnections: 6
|
13 |
+
pafthreshold: 0.1
|
14 |
+
topktoretain: 3
|
15 |
+
upperbound_factor: 1.25
|
16 |
+
variant: 0
|
17 |
+
withid: false
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/test/pose_cfg.yaml
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
all_joints:
|
2 |
+
- - 0
|
3 |
+
- - 1
|
4 |
+
- - 2
|
5 |
+
- - 3
|
6 |
+
- - 4
|
7 |
+
- - 5
|
8 |
+
- - 6
|
9 |
+
- - 7
|
10 |
+
- - 8
|
11 |
+
- - 9
|
12 |
+
- - 10
|
13 |
+
- - 11
|
14 |
+
all_joints_names:
|
15 |
+
- snout
|
16 |
+
- leftear
|
17 |
+
- rightear
|
18 |
+
- shoulder
|
19 |
+
- spine1
|
20 |
+
- spine2
|
21 |
+
- spine3
|
22 |
+
- spine4
|
23 |
+
- tailbase
|
24 |
+
- tail1
|
25 |
+
- tail2
|
26 |
+
- tailend
|
27 |
+
dataset: training-datasets/iteration-1/UnaugmentedDataSet_MultiMouseDec16/MultiMouse_Daniel95shuffle0.pickle
|
28 |
+
dataset_type: multi-animal-imgaug
|
29 |
+
global_scale: 0.8
|
30 |
+
init_weights: /home/alex/anaconda3/envs/DLC-GPU/lib/python3.7/site-packages/deeplabcut/pose_estimation_tensorflow/models/pretrained/resnet_v1_50.ckpt
|
31 |
+
location_refinement: true
|
32 |
+
locref_stdev: 7.2801
|
33 |
+
minconfidence: 0.01
|
34 |
+
net_type: resnet_50
|
35 |
+
nmsradius: 5.0
|
36 |
+
num_joints: 12
|
37 |
+
num_limbs: 66
|
38 |
+
pairwise_predict: false
|
39 |
+
partaffinityfield_graph:
|
40 |
+
- - 0
|
41 |
+
- 1
|
42 |
+
- - 0
|
43 |
+
- 2
|
44 |
+
- - 0
|
45 |
+
- 3
|
46 |
+
- - 0
|
47 |
+
- 4
|
48 |
+
- - 0
|
49 |
+
- 5
|
50 |
+
- - 0
|
51 |
+
- 6
|
52 |
+
- - 0
|
53 |
+
- 7
|
54 |
+
- - 0
|
55 |
+
- 8
|
56 |
+
- - 0
|
57 |
+
- 9
|
58 |
+
- - 0
|
59 |
+
- 10
|
60 |
+
- - 0
|
61 |
+
- 11
|
62 |
+
- - 1
|
63 |
+
- 2
|
64 |
+
- - 1
|
65 |
+
- 3
|
66 |
+
- - 1
|
67 |
+
- 4
|
68 |
+
- - 1
|
69 |
+
- 5
|
70 |
+
- - 1
|
71 |
+
- 6
|
72 |
+
- - 1
|
73 |
+
- 7
|
74 |
+
- - 1
|
75 |
+
- 8
|
76 |
+
- - 1
|
77 |
+
- 9
|
78 |
+
- - 1
|
79 |
+
- 10
|
80 |
+
- - 1
|
81 |
+
- 11
|
82 |
+
- - 2
|
83 |
+
- 3
|
84 |
+
- - 2
|
85 |
+
- 4
|
86 |
+
- - 2
|
87 |
+
- 5
|
88 |
+
- - 2
|
89 |
+
- 6
|
90 |
+
- - 2
|
91 |
+
- 7
|
92 |
+
- - 2
|
93 |
+
- 8
|
94 |
+
- - 2
|
95 |
+
- 9
|
96 |
+
- - 2
|
97 |
+
- 10
|
98 |
+
- - 2
|
99 |
+
- 11
|
100 |
+
- - 3
|
101 |
+
- 4
|
102 |
+
- - 3
|
103 |
+
- 5
|
104 |
+
- - 3
|
105 |
+
- 6
|
106 |
+
- - 3
|
107 |
+
- 7
|
108 |
+
- - 3
|
109 |
+
- 8
|
110 |
+
- - 3
|
111 |
+
- 9
|
112 |
+
- - 3
|
113 |
+
- 10
|
114 |
+
- - 3
|
115 |
+
- 11
|
116 |
+
- - 4
|
117 |
+
- 5
|
118 |
+
- - 4
|
119 |
+
- 6
|
120 |
+
- - 4
|
121 |
+
- 7
|
122 |
+
- - 4
|
123 |
+
- 8
|
124 |
+
- - 4
|
125 |
+
- 9
|
126 |
+
- - 4
|
127 |
+
- 10
|
128 |
+
- - 4
|
129 |
+
- 11
|
130 |
+
- - 5
|
131 |
+
- 6
|
132 |
+
- - 5
|
133 |
+
- 7
|
134 |
+
- - 5
|
135 |
+
- 8
|
136 |
+
- - 5
|
137 |
+
- 9
|
138 |
+
- - 5
|
139 |
+
- 10
|
140 |
+
- - 5
|
141 |
+
- 11
|
142 |
+
- - 6
|
143 |
+
- 7
|
144 |
+
- - 6
|
145 |
+
- 8
|
146 |
+
- - 6
|
147 |
+
- 9
|
148 |
+
- - 6
|
149 |
+
- 10
|
150 |
+
- - 6
|
151 |
+
- 11
|
152 |
+
- - 7
|
153 |
+
- 8
|
154 |
+
- - 7
|
155 |
+
- 9
|
156 |
+
- - 7
|
157 |
+
- 10
|
158 |
+
- - 7
|
159 |
+
- 11
|
160 |
+
- - 8
|
161 |
+
- 9
|
162 |
+
- - 8
|
163 |
+
- 10
|
164 |
+
- - 8
|
165 |
+
- 11
|
166 |
+
- - 9
|
167 |
+
- 10
|
168 |
+
- - 9
|
169 |
+
- 11
|
170 |
+
- - 10
|
171 |
+
- 11
|
172 |
+
partaffinityfield_predict: 'True'
|
173 |
+
scoremap_dir: test
|
174 |
+
project_path: /home/jessy/DeepLabCut/demo-me-2021-07-14
|
175 |
+
bank3: 128
|
176 |
+
bank5: 128
|
177 |
+
smfactor: 4
|
178 |
+
stride: 4
|
179 |
+
multi_stage: true
|
180 |
+
paf_best:
|
181 |
+
- 30
|
182 |
+
- 38
|
183 |
+
- 39
|
184 |
+
- 46
|
185 |
+
- 21
|
186 |
+
- 12
|
187 |
+
- 63
|
188 |
+
- 57
|
189 |
+
- 56
|
190 |
+
- 65
|
191 |
+
- 2
|
192 |
+
- 51
|
193 |
+
- 40
|
194 |
+
- 45
|
195 |
+
- 22
|
196 |
+
- 31
|
197 |
+
- 33
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/pose_cfg.yaml
ADDED
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
all_joints:
|
2 |
+
- - 0
|
3 |
+
- - 1
|
4 |
+
- - 2
|
5 |
+
- - 3
|
6 |
+
- - 4
|
7 |
+
- - 5
|
8 |
+
- - 6
|
9 |
+
- - 7
|
10 |
+
- - 8
|
11 |
+
- - 9
|
12 |
+
- - 10
|
13 |
+
- - 11
|
14 |
+
all_joints_names:
|
15 |
+
- snout
|
16 |
+
- leftear
|
17 |
+
- rightear
|
18 |
+
- shoulder
|
19 |
+
- spine1
|
20 |
+
- spine2
|
21 |
+
- spine3
|
22 |
+
- spine4
|
23 |
+
- tailbase
|
24 |
+
- tail1
|
25 |
+
- tail2
|
26 |
+
- tailend
|
27 |
+
batch_size: 4
|
28 |
+
cropratio: 0.6
|
29 |
+
dataset: training-datasets/iteration-1/UnaugmentedDataSet_MultiMouseDec16/MultiMouse_Daniel95shuffle0.pickle
|
30 |
+
dataset_type: multi-animal-imgaug
|
31 |
+
init_weights: /media/data/mu/MultiMouse-Daniel-2019-12-16/multistage5_single-shortcut-3M-DLC-benchmarkinghr_stride4_fc_p20/dlc-models/iteration-1/MultiMouseDec16-trainset95shuffle0/train/snapshot-60000
|
32 |
+
display_iters: 100
|
33 |
+
global_scale: 0.8
|
34 |
+
intermediate_supervision: false
|
35 |
+
intermediate_supervision_layer: 12
|
36 |
+
location_refinement: true
|
37 |
+
locref_huber_loss: true
|
38 |
+
locref_loss_weight: 0.05
|
39 |
+
locref_stdev: 7.2801
|
40 |
+
max_input_size: 1500
|
41 |
+
metadataset: training-datasets/iteration-1/UnaugmentedDataSet_MultiMouseDec16/Documentation_data-MultiMouse_95shuffle0.pickle
|
42 |
+
min_input_size: 64
|
43 |
+
mirror: false
|
44 |
+
multi_step:
|
45 |
+
- - 0.0001
|
46 |
+
- 7500
|
47 |
+
- - 5e-05
|
48 |
+
- 12000
|
49 |
+
- - 1e-05
|
50 |
+
- 500000
|
51 |
+
net_type: resnet_50
|
52 |
+
num_joints: 12
|
53 |
+
num_limbs: 66
|
54 |
+
optimizer: adam
|
55 |
+
pafwidth: 12
|
56 |
+
pairwise_huber_loss: false
|
57 |
+
pairwise_loss_weight: 1
|
58 |
+
pairwise_predict: false
|
59 |
+
partaffinityfield_graph:
|
60 |
+
- - 0
|
61 |
+
- 1
|
62 |
+
- - 0
|
63 |
+
- 2
|
64 |
+
- - 0
|
65 |
+
- 3
|
66 |
+
- - 0
|
67 |
+
- 4
|
68 |
+
- - 0
|
69 |
+
- 5
|
70 |
+
- - 0
|
71 |
+
- 6
|
72 |
+
- - 0
|
73 |
+
- 7
|
74 |
+
- - 0
|
75 |
+
- 8
|
76 |
+
- - 0
|
77 |
+
- 9
|
78 |
+
- - 0
|
79 |
+
- 10
|
80 |
+
- - 0
|
81 |
+
- 11
|
82 |
+
- - 1
|
83 |
+
- 2
|
84 |
+
- - 1
|
85 |
+
- 3
|
86 |
+
- - 1
|
87 |
+
- 4
|
88 |
+
- - 1
|
89 |
+
- 5
|
90 |
+
- - 1
|
91 |
+
- 6
|
92 |
+
- - 1
|
93 |
+
- 7
|
94 |
+
- - 1
|
95 |
+
- 8
|
96 |
+
- - 1
|
97 |
+
- 9
|
98 |
+
- - 1
|
99 |
+
- 10
|
100 |
+
- - 1
|
101 |
+
- 11
|
102 |
+
- - 2
|
103 |
+
- 3
|
104 |
+
- - 2
|
105 |
+
- 4
|
106 |
+
- - 2
|
107 |
+
- 5
|
108 |
+
- - 2
|
109 |
+
- 6
|
110 |
+
- - 2
|
111 |
+
- 7
|
112 |
+
- - 2
|
113 |
+
- 8
|
114 |
+
- - 2
|
115 |
+
- 9
|
116 |
+
- - 2
|
117 |
+
- 10
|
118 |
+
- - 2
|
119 |
+
- 11
|
120 |
+
- - 3
|
121 |
+
- 4
|
122 |
+
- - 3
|
123 |
+
- 5
|
124 |
+
- - 3
|
125 |
+
- 6
|
126 |
+
- - 3
|
127 |
+
- 7
|
128 |
+
- - 3
|
129 |
+
- 8
|
130 |
+
- - 3
|
131 |
+
- 9
|
132 |
+
- - 3
|
133 |
+
- 10
|
134 |
+
- - 3
|
135 |
+
- 11
|
136 |
+
- - 4
|
137 |
+
- 5
|
138 |
+
- - 4
|
139 |
+
- 6
|
140 |
+
- - 4
|
141 |
+
- 7
|
142 |
+
- - 4
|
143 |
+
- 8
|
144 |
+
- - 4
|
145 |
+
- 9
|
146 |
+
- - 4
|
147 |
+
- 10
|
148 |
+
- - 4
|
149 |
+
- 11
|
150 |
+
- - 5
|
151 |
+
- 6
|
152 |
+
- - 5
|
153 |
+
- 7
|
154 |
+
- - 5
|
155 |
+
- 8
|
156 |
+
- - 5
|
157 |
+
- 9
|
158 |
+
- - 5
|
159 |
+
- 10
|
160 |
+
- - 5
|
161 |
+
- 11
|
162 |
+
- - 6
|
163 |
+
- 7
|
164 |
+
- - 6
|
165 |
+
- 8
|
166 |
+
- - 6
|
167 |
+
- 9
|
168 |
+
- - 6
|
169 |
+
- 10
|
170 |
+
- - 6
|
171 |
+
- 11
|
172 |
+
- - 7
|
173 |
+
- 8
|
174 |
+
- - 7
|
175 |
+
- 9
|
176 |
+
- - 7
|
177 |
+
- 10
|
178 |
+
- - 7
|
179 |
+
- 11
|
180 |
+
- - 8
|
181 |
+
- 9
|
182 |
+
- - 8
|
183 |
+
- 10
|
184 |
+
- - 8
|
185 |
+
- 11
|
186 |
+
- - 9
|
187 |
+
- 10
|
188 |
+
- - 9
|
189 |
+
- 11
|
190 |
+
- - 10
|
191 |
+
- 11
|
192 |
+
partaffinityfield_predict: true
|
193 |
+
pos_dist_thresh: 17
|
194 |
+
project_path: /media/data/mu/MultiMouse-Daniel-2019-12-16
|
195 |
+
rotation: 180
|
196 |
+
rotratio: 0.4
|
197 |
+
save_iters: 10000
|
198 |
+
scale_jitter_lo: 0.5
|
199 |
+
scale_jitter_up: 1.2
|
200 |
+
weigh_only_present_joints: false
|
201 |
+
augmentationprobability: 0.5
|
202 |
+
fliplr: true
|
203 |
+
hist_eq: true
|
204 |
+
cropfactor: 0.2
|
205 |
+
covering: true
|
206 |
+
motion_blur:
|
207 |
+
- - k
|
208 |
+
- 7
|
209 |
+
- - angle
|
210 |
+
- - -90
|
211 |
+
- 90
|
212 |
+
elastic_transform: true
|
213 |
+
scmap_type: plateau
|
214 |
+
bank3: 128
|
215 |
+
bank5: 128
|
216 |
+
smfactor: 4
|
217 |
+
stride: 4
|
218 |
+
multi_stage: true
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.data-00000-of-00001
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d5394bc9b0ee1d3d63925bb576d77e5de301c32db04354884e132fb24a549bba
|
3 |
+
size 126433952
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.index
ADDED
Binary file (13.3 kB). View file
|
|
kunin-dlc-240814/dlc-models/iteration-0/demoAug14-trainset95shuffle0/train/snapshot-20000.meta
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc422d6f46571404d6b9a30bc4a475058022d922f589951de1b5abd9359bd6c4
|
3 |
+
size 2896929
|
kunin-dlc-240814/labeled-data/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
kunin-dlc-240814/videos/.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|