|
6 | 6 | https://github.com/SchwarzNeuroconLab/DeepLabStream |
7 | 7 | Licensed under GNU General Public License v3.0 |
8 | 8 | """ |
9 | | -import time |
| 9 | +import multiprocessing as mp |
10 | 10 | import os |
11 | 11 | import sys |
12 | | -import multiprocessing as mp |
| 12 | +import time |
13 | 13 | from importlib.util import find_spec |
14 | 14 |
|
| 15 | +import click |
15 | 16 | import cv2 |
16 | 17 | import numpy as np |
17 | 18 | import pandas as pd |
18 | | -import click |
19 | 19 |
|
20 | | -from utils.configloader import RESOLUTION, FRAMERATE, OUT_DIR, MODEL_NAME, MULTI_CAM, STACK_FRAMES, \ |
21 | | - ANIMALS_NUMBER, STREAMS, STREAMING_SOURCE |
22 | | -from utils.poser import load_deeplabcut, get_pose, find_local_peaks_new, calculate_skeletons,\ |
23 | | - get_ma_pose, calculate_ma_skeletons, calculate_skeletons_dlc_live, transform_2skeleton |
24 | | -from utils.plotter import plot_bodyparts, plot_metadata_frame |
| 20 | +from utils.configloader import RESOLUTION,FRAMERATE,OUT_DIR,MODEL_NAME,MULTI_CAM,STACK_FRAMES, \ |
| 21 | + ANIMALS_NUMBER,STREAMS,STREAMING_SOURCE |
| 22 | +from utils.plotter import plot_bodyparts,plot_metadata_frame |
| 23 | +from utils.poser import load_deeplabcut,get_pose,calculate_skeletons |
25 | 24 |
|
26 | 25 |
|
27 | 26 | def create_video_files(directory, devices, resolution, framerate, codec): |
@@ -284,7 +283,7 @@ def get_pose_mp(input_q, output_q): |
284 | 283 | index, frame = input_q.get() |
285 | 284 | if MODEL_ORIGIN == 'DLC': |
286 | 285 | scmap, locref, pose = get_pose(frame, config, sess, inputs, outputs) |
287 | | - # TODO: REmove alterations to original |
| 286 | + # TODO: Remove alterations to original |
288 | 287 | #peaks = find_local_peaks_new(scmap, locref, ANIMALS_NUMBER, config) |
289 | 288 | peaks = pose |
290 | 289 | if MODEL_ORIGIN == 'MADLC': |
@@ -409,9 +408,7 @@ def get_analysed_frames(self) -> tuple: |
409 | 408 |
|
410 | 409 | # Getting the analysed data |
411 | 410 | analysed_index, peaks = self._multiprocessing[camera]['output'].get() |
412 | | - #TODO: REMOVE IF USELESS |
413 | | - skeletons = [transform_2skeleton(peaks)] |
414 | | - #skeletons = calculate_skeletons(peaks, ANIMALS_NUMBER) |
| 411 | + skeletons = calculate_skeletons(peaks, ANIMALS_NUMBER) |
415 | 412 | print('', end='\r', flush=True) # this is the line you should not remove |
416 | 413 | analysed_frame, depth_map, input_time = self.get_stored_frames(camera) |
417 | 414 | analysis_time = time.time() - input_time |
|
0 commit comments