# Path: third_party/ext_utils/joint_catalog.py
# class SMALJointInfo():
#     def __init__(self):
#         # These are the 
#         self.annotated_classes = np.array([
#             8, 9, 10, # upper_right
#             12, 13, 14, # upper_left
#             15, # neck
#             18, 19, 20, # lower_right
#             22, 23, 24, # lower_left
#             25, 28, 31, # tail
#             32, 33, # head
#             35, # right_ear
#             36]) # left_ear
# 
#         self.annotated_markers = np.array([
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR,
#             cv2.MARKER_CROSS,
#             cv2.MARKER_CROSS])
# 
#         self.joint_regions = np.array([ 
#             0, 0, 0, 0, 0, 0, 0,
#             1, 1, 1, 1, 
#             2, 2, 2, 2, 
#             3, 3, 
#             4, 4, 4, 4, 
#             5, 5, 5, 5, 
#             6, 6, 6, 6, 6, 6, 6,
#             7, 7, 7,
#             8, 
#             9])
# 
#         self.annotated_joint_region = self.joint_regions[self.annotated_classes]
#         self.region_colors = np.array([
#             [250, 190, 190], # body, light pink
#             [60, 180, 75], # upper_right, green
#             [230, 25, 75], # upper_left, red
#             [128, 0, 0], # neck, maroon
#             [0, 130, 200], # lower_right, blue
#             [255, 255, 25], # lower_left, yellow
#             [240, 50, 230], # tail, majenta
#             [245, 130, 48], # jaw / nose / chin, orange
#             [29, 98, 115], # right_ear, turquoise
#             [255, 153, 204]]) # left_ear, pink
#         
#         self.joint_colors = np.array(self.region_colors)[self.annotated_joint_region]


import pdb
import numpy as np
import imageio
import json
import os
import cv2
import sys
from random import shuffle
from .joint_catalog import SMALJointInfo
# GNU General Public License for more details.

###########################################################################################################################
# Benjamin Biggs | bjb56@cam.ac.uk | http://mi.eng.cam.ac.uk/~bjb56/                                                      #
# Please cite `Creatures Great and SMAL: Recovering the shape and motion of animals from video' if you use this dataset   #
###########################################################################################################################
#import scipy.misc


BADJA_PATH = './database'

class BADJAData():
    def __init__(self, seqname):
        annotations_path = os.path.join(BADJA_PATH, "joint_annotations")
        IGNORE_ANIMALS = [
             "bear.json",
             "camel.json",
            "cat_jump.json",
             "cows.json",
             "dog.json",
             "dog-agility.json",
             "horsejump-high.json",
             "horsejump-low.json",
             "impala0.json",
             "rs_dog.json",
            "tiger.json"
            ]
        IGNORE_ANIMALS = [i for i in IGNORE_ANIMALS if '%s.json'%seqname != i]

        self.animal_dict = {}

# Path: third_party/ext_utils/joint_catalog.py
# class SMALJointInfo():
#     def __init__(self):
#         # These are the 
#         self.annotated_classes = np.array([
#             8, 9, 10, # upper_right
#             12, 13, 14, # upper_left
#             15, # neck
#             18, 19, 20, # lower_right
#             22, 23, 24, # lower_left
#             25, 28, 31, # tail
#             32, 33, # head
#             35, # right_ear
#             36]) # left_ear
# 
#         self.annotated_markers = np.array([
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR, cv2.MARKER_TRIANGLE_DOWN,
#             cv2.MARKER_CROSS, cv2.MARKER_STAR,
#             cv2.MARKER_CROSS,
#             cv2.MARKER_CROSS])
# 
#         self.joint_regions = np.array([ 
#             0, 0, 0, 0, 0, 0, 0,
#             1, 1, 1, 1, 
#             2, 2, 2, 2, 
#             3, 3, 
#             4, 4, 4, 4, 
#             5, 5, 5, 5, 
#             6, 6, 6, 6, 6, 6, 6,
#             7, 7, 7,
#             8, 
#             9])
# 
#         self.annotated_joint_region = self.joint_regions[self.annotated_classes]
#         self.region_colors = np.array([
#             [250, 190, 190], # body, light pink
#             [60, 180, 75], # upper_right, green
#             [230, 25, 75], # upper_left, red
#             [128, 0, 0], # neck, maroon
#             [0, 130, 200], # lower_right, blue
#             [255, 255, 25], # lower_left, yellow
#             [240, 50, 230], # tail, majenta
#             [245, 130, 48], # jaw / nose / chin, orange
#             [29, 98, 115], # right_ear, turquoise
#             [255, 153, 204]]) # left_ear, pink
#         
#         self.joint_colors = np.array(self.region_colors)[self.annotated_joint_region]


# Path: third_party/ext_utils/badja_data.py
import pdb
import numpy as np
import imageio
import json
import os
import cv2
import sys
from random import shuffle
from .joint_catalog import SMALJointInfo

# GNU General Public License for more details.

###########################################################################################################################
# Benjamin Biggs | bjb56@cam.ac.uk | http://mi.eng.cam.ac.uk/~bjb56/                                                      #
# Please cite `Creatures Great and SMAL: Recovering the shape and motion of animals from video' if you use this dataset   #
###########################################################################################################################
#import scipy.misc


BADJA_PATH = './database'

class BADJAData():
    def __init__(self, seqname):
        annotations_path = os.path.join(BADJA_PATH, "joint_annotations")
        IGNORE_ANIMALS = [
             "bear.json",
             "camel.json",
            "cat_jump.json",
             "cows.json",
             "dog.json",
             "dog-agility.json",
             "horsejump-high.json",
             "horsejump-low.json",
             "impala0.json",
             "rs_dog.json",
            "tiger.json"
            ]
        IGNORE_ANIMALS = [i for i in IGNORE_ANIMALS if '%s.json'%seqname != i]

        self.animal_dict = {}

        self.smal_joint_info = SMALJointInfo()