Exemplo n.º 1
0
 def test__create_joints2(self):
     d = pickle.load(open("test_case2", "rb"))
     self.kpts = d["kpts"]
     self.pafs = d["pafs"]
     self.sk = post.Skeletonizer(self.kpts, self.pafs)
     potential_kpts = self.sk._localize_potential_kpts()
     self.sk._create_joints(potential_kpts)
 def process_image(self, img):
     input_img = tf.image.resize(
         img, (def_config.IMAGE_HEIGHT, def_config.IMAGE_WIDTH))
     input_img = tf.image.convert_image_dtype(input_img, dtype=tf.float32)
     input_img /= 255
     input_img = input_img[tf.newaxis, ...]
     pafs, kpts = self.model.predict(input_img)
     pafs = pafs[0]
     kpts = kpts[0]
     skeletonizer = post.Skeletonizer(kpts, pafs)
     skeletons = skeletonizer.create_skeletons()
     return skeletons
Exemplo n.º 3
0
 def test_create_skeletons(self):
     d = pickle.load(open("test_case1", "rb"))
     self.kpts = d["kpts"]
     self.pafs = d["pafs"]
     self.sk = post.Skeletonizer(self.kpts, self.pafs)
     self.sk.create_skeletons()