Real-time single person pose estimation for Android and iOS.

Overview

This repository currently implemented the CPM and Hourglass model using TensorFlow. Instead of normal convolution, inverted residuals (also known as Mobilenet V2) module has been used inside the model for real-time inference.

Model FLOPs PCKh Inference Time
CPM 0.5G 93.78 ~60 FPS on Snapdragon 845
~60 FPS on iPhone XS (need more test)
Hourglass 0.5G 91.81

You can modify the architectures of network for training much higher PCKh model.

Note: The repository only provide the baseline for mobile inference. Both model architectures (accuracy) and dataset still have a huge margin of improvement.

The respository contains:

  • Code of training cpm & hourglass model
  • Android demo source code (thanks to littleGnAl)
  • iOS demo source code (thanks to tucan)

Below GIF is the performance of Android and iOS

Android Mi Mix2s (~60 FPS) iPhone X (~30 FPS)
image image

You can download the apk as below to test on your device.

Using Mace (Support GPU) Using TFlite (Only CPU)
PoseEstimation-Mace.apk PoseEstimation-TFlite.apk

Issue and PR are welcome when you come across any problem.

Training


Dependencies:

  • Python3
  • TensorFlow >= 1.4
  • Mace

Dataset:

Training dataset available through google driver.

Unzip it will obtain the following file structure

# root @ ubuntu in ~/hdd/ai_challenger
$ tree -L 1 .
.
├── ai_challenger_train.json
├── ai_challenger_valid.json
├── train
└── valid

The traing dataset only contains single person images and it come from the competition of AI Challenger.

  • 22446 training examples
  • 1500 testing examples

I transfer the annotation into COCO format for using the data augument code from tf-pose-estimation respository.

Hyper-parameter

In training procedure, we use cfg file on experiments folder for passing the hyper-parameter.

Below is the content of mv2_cpm.cfg.

[Train]
model: 'mv2_cpm'
checkpoint: False
datapath: '/root/hdd/ai_challenger'
imgpath: '/root/hdd/'
visible_devices: '0, 1, 2'
multiprocessing_num: 8
max_epoch: 1000
lr: '0.001'
batchsize: 5
decay_rate: 0.95
input_width: 192
input_height: 192
n_kpoints: 14
scale: 2
modelpath: '/root/hdd/trained/mv2_cpm/models'
logpath: '/root/hdd/trained/mv2_cpm/log'
num_train_samples: 20000
per_update_tensorboard_step: 500
per_saved_model_step: 2000
pred_image_on_tensorboard: True

The cfg not cover all the parameters of the model, there still have some parameters in the network_mv2_cpm.py.

Train by nvidia-docker

Build the docker by the following command:

cd training/docker
docker build -t single-pose .

or

docker pull edvardhua/single-pose

Then run the following command to train the model:

nvidia-docker run -it -d \
-v <dataset_path>:/data5 -v <training_code_path>/training:/workspace \
-p 6006:6006 -e LOG_PATH=/root/hdd/trained/mv2_cpm/log \
-e PARAMETERS_FILE=experiments/mv2_cpm.cfg edvardhua/single-pose

Also, it will create the tensorboard on port 6006. Beside, make sure you install the nvidia-docker.

Train by ordinary way

  1. (mac only) Change tensorflow-gpu==1.4.0 to tensorflow==1.4.0 on requirements.txt.

  2. install the dependencies.

cd training
pip3 install -r requirements.txt

Beside, you also need to install cocoapi

  1. Edit the parameters files in experiments folder, it contains almost all the hyper-parameters and other configuration you need to define in training. After that, passing the parameters file to start the training:
cd training
python3 src/train.py experiments/mv2_cpm.cfg

After 12 hour training, the model is almost coverage on 3 Nvidia 1080Ti graphics cards, below is the corresponding plot on tensorboard.

image

Bechmark (PCKh)

Run the follow command to evaluate the value of your PCKh.

python3 src/benchmark.py --frozen_pb_path=hourglass/model-360000.pb \
--anno_json_path=/root/hdd/ai_challenger/ai_challenger_valid.json \
--img_path=/root/hdd \
--output_node_name=hourglass_out_3

Pretain model

CPM

Hourglass

Android Demo


Thanks to mace framework, now you can using GPU to run this model on android smartphone.

Following command can transfer model into mace format.

cd <your-mace-path>
# You transer hourglass or cpm model by changing `yml` file.
python tools/converter.py convert --config=<PoseEstimationForMobilePath>/release/mace_ymls/cpm.yml

Then follow the instruction of mace-0.9 documentation to integrate into android.

For how to invoke the model and parsing output, you can check the android source code i provided.

The benchmark of some socs for average inference time are shown as follow.

Model Snapdragon 845 Snapdragon 660 Hisilicon 960 Exynos 7420
CPM & Hourglass 17 ms 30 ms 42 ms 103 ms

Below is the environments i build this demo.

  • Operation System: macOS 10.13.6 (mace not support build under windows now)
  • Android Studio: 3.0.1
  • NDK Version: r16
  • Mace Version: 0.9.0

Different environments may encounter different error when you build mace-demo. To avoid this, i suggest using docker.

docker pull registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite

docker run -it
	--privileged -d --name mace-dev 
	--net=host 
	-v to/you/path/PoseEstimationForMobile/android_demo/demo_mace:/demo_mace 
	registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite

docker run -it --privileged -d --name mace-dev --net=host \
           -v to/you/path/PoseEstimationForMobile/android_demo/demo_mace:/demo_mace  \
           registry.cn-hangzhou.aliyuncs.com/xiaomimace/mace-dev-lite

# Enter to docker
docker exec -it mace-dev bash

# Exec command inside the docker
cd /demo_mace && ./gradlew build

Or you can transfer the model into tflite.

# Convert to frozen pb.
cd training
python3 src/gen_frozen_pb.py \
--checkpoint=<you_training_model_path>/model-xxx --output_graph=<you_output_model_path>/model-xxx.pb \
--size=192 --model=mv2_cpm_2

# If you update tensorflow to 1.9, run following command.
python3 src/gen_tflite_coreml.py \
--frozen_pb=forzen_graph.pb \
--input_node_name='image' \
--output_node_name='Convolutional_Pose_Machine/stage_5_out' \
--output_path='./' \
--type=tflite
 
# Convert to tflite.
# See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/mobile/tflite/devguide.md for more information.
bazel-bin/tensorflow/contrib/lite/toco/toco \
--input_file=<you_output_model_path>/model-xxx.pb \
--output_file=<you_output_tflite_model_path>/mv2-cpm.tflite \
--input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE \
--inference_type=FLOAT \
--input_shape="1,192,192,3" \
--input_array='image' \
--output_array='Convolutional_Pose_Machine/stage_5_out'

Then, place the tflite file in android_demo/app/src/main/assets and modify the parameters in ImageClassifierFloatInception.kt.

......
......
    // parameters need to modify in ImageClassifierFloatInception.kt
    /**
     * Create ImageClassifierFloatInception instance
     *
     * @param imageSizeX Get the image size along the x axis.
     * @param imageSizeY Get the image size along the y axis.
     * @param outputW The output width of model
     * @param outputH The output height of model
     * @param modelPath Get the name of the model file stored in Assets.
     * @param numBytesPerChannel Get the number of bytes that is used to store a single
     * color channel value.
     */
    fun create(
      activity: Activity,
      imageSizeX: Int = 192,
      imageSizeY: Int = 192,
      outputW: Int = 96,
      outputH: Int = 96,
      modelPath: String = "mv2-cpm.tflite",
      numBytesPerChannel: Int = 4
    ): ImageClassifierFloatInception =
      ImageClassifierFloatInception(
          activity,
          imageSizeX,
          imageSizeY,
          outputW,
          outputH,
          modelPath,
          numBytesPerChannel)
......
......

Finally, import the project to Android Studio and run in you smartphone.

iOS Demo


Thanks to tucan, now you can run model on iOS.

First, convert model into CoreML model.

# Convert to frozen pb.
cd training
python3 src/gen_frozen_pb.py \
--checkpoint=<you_training_model_path>/model-xxx --output_graph=<you_output_model_path>/model-xxx.pb \
--size=192 --model=mv2_cpm_2

# Run the following command to get mlmodel
python3 src/gen_tflite_coreml.py \
--frozen_pb=forzen_graph.pb \
--input_node_name='image' \
--output_node_name='Convolutional_Pose_Machine/stage_5_out' \
--output_path='./' \
--type=coreml

Then, follow the instruction on PoseEstimation-CoreML.

The benchmark of some socs for average inference time are shown as follow.

Model iPhone XS Max iPhone XS iPhone X iPhone 8 Plus iPhone 8
CPM & Hourglass 17 ms 16 ms 69 ms 64 ms 42 ms
Model iPhone 7 iPad Pro
(10.5-inch)
iPhone SE iPad
(5th)
iPhone 6 Plus
CPM & Hourglass 74 ms 41 ms 103 ms 118 ms 331 ms

Reference


[1] Paper of Convolutional Pose Machines
[2] Paper of Stack Hourglass
[3] Paper of MobileNet V2
[4] Repository PoseEstimation-CoreML
[5] Repository of tf-pose-estimation
[6] Devlope guide of TensorFlow Lite
[7] Mace documentation

License


Apache License 2.0

Comments
  • I want to convert to model for Core ML that is iOS ML framework(Done).

    I want to convert to model for Core ML that is iOS ML framework(Done).

    Hi, I'm iOS developer and I want to run this model on iOS. I found tflite model, but I need frozen pb model for converting to Core ML model. Can I get frozen pb model?

    opened by tucan9389 10
  • 训练输入长宽比不为1:1时报错。

    训练输入长宽比不为1:1时报错。

    @edvardHua 你好,我在mv2_hourglass.cfg将宽高比设置成192x256后训练,报了下面的错误。 InvalidArgumentError (see above for traceback): Incompatible shapes: [16,14,6,8] vs. [16,14,8,6] 这里为什么长跟高位置调转了呢?是不是前面有什么操作处理导致的?输入为192x192的时候是能正常训练的。我对tensorflow掌握得不深没有找出问题在哪里,希望作者能给点提示,谢谢~

    `Caused by op 'GPU_0/hourglass_out_0', defined at: File "src/train.py", line 225, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "src/train.py", line 124, in main loss, last_heat_loss, pred_heat = get_loss_and_output(params['model'], params['batchsize'], input_image, input_heat, reuse_variable) File "src/train.py", line 42, in get_loss_and_output , pred_heatmaps_all = get_network(model, input_image, True) File "/home/cwd/project/PoseEstimationForMobile/training/src/networks.py", line 15, in get_network net, loss = network_mv2_hourglass.build_network(input, trainable) File "/home/cwd/project/PoseEstimationForMobile/training/src/network_mv2_hourglass.py", line 88, in build_network hg_out = hourglass_module(net, STAGE_NUM) File "/home/cwd/project/PoseEstimationForMobile/training/src/network_mv2_hourglass.py", line 34, in hourglass_module block_mid = hourglass_module(block_front, stage_nums) File "/home/cwd/project/PoseEstimationForMobile/training/src/network_mv2_hourglass.py", line 34, in hourglass_module block_mid = hourglass_module(block_front, stage_nums) File "/home/cwd/project/PoseEstimationForMobile/training/src/network_mv2_hourglass.py", line 34, in hourglass_module block_mid = hourglass_module(block_front, stage_nums) File "/home/cwd/project/PoseEstimationForMobile/training/src/network_mv2_hourglass.py", line 51, in hourglass_module curr_hg_out = tf.add(up_sample, branch_jump, name="hourglass_out%d" % stage_nums) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 297, in add "Add", x=x, y=y, name=name) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3414, in create_op op_def=op_def) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1740, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

    InvalidArgumentError (see above for traceback): Incompatible shapes: [16,14,6,8] vs. [16,14,8,6] [[Node: GPU_0/hourglass_out_0 = Add[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](GPU_0/hourglass_out_0-0-TransposeNHWCToNCHW-LayoutOptimizer, GPU_0/hourglass_branch_jump_0/inverted_bottleneck_hourglass_branch_jump_0_5/hourglass_branch_jump_0_5_pointwise/BatchNorm/Relu6)]]

    `

    opened by accountcwd 6
  • Hand pose estimation

    Hand pose estimation

    Hey. I know that I am not the first to ask this, but I decided by your example and data from http://domedb.perception.cs.cmu.edu/handdb.html to do hand pose estimation. But my knowledge is not enough to adjust the learning itself. The model will have 21 key points. Can you tell in which places and what needs to be corrected in code? In addition to the configuration of course. Thanks in advance for the hint and sorry for my bad english

    opened by AndrGolubkov 5
  • Is it possible to train other estimation like fingertip?

    Is it possible to train other estimation like fingertip?

    I have fingertip dataset that are images + label, and I want to train the dataset. Is it possible to train fingertip estimation by using this project?

    label format:

    I_Fountain_xxx.png tlx tly brx bry ftx fty jntx jnty tjntx tjnty 0 0 0 0
    I_RenwenBuilding_xxx.png tlx tly brx bry ftx fty jntx jnty tjntx tjnty 0 0 0 0
    I_Chinesebook_xxx.png tlx tly brx bry ftx fty jntx jnty tjntx tjnty 0 0 0 0
    
    • tlx && tly: bounding box top-left point (x, y)
    • brx&& bry: bounding box bottom-right point (x, y)
    • ftx && fty: fingertip point (x, y)
    • jntx&&jnty: index finger joint point (x, y)
    • tjntx&&tjnty: tail finger joint point (x, y)

    Thanks always.

    opened by tucan9389 4
  • Custom Trainingset On New Usecase - Poor Results

    Custom Trainingset On New Usecase - Poor Results

    Hi everyone!

    First of all, thank you @edvardHua and @tucan9389 for your amazing work in this project!

    I am repurposing the pose estimation for another usecase: 3D objects. For this, I created a synthetic dataset of an Airfryer using a 3D CAD model. My trainingset consists of 6300 trainingsimages and 700 validation images. I use random images as backgrounds to simulate reflections in my 3D object. A few handpicked examples: airfryer_handpicked

    I trained a CPM model for about 113000 steps, converted the model into .pb, then into .mlmodel and tested in on @tucan9389 IOS app and another IOS app that I found.. Using benchmark,py I get: PCKh=99.47 I dont really understand this measurement that well, but I suppose that high values are better for PCKh.

    However, performance in the app on the real-life object and the synthetic trainings-data directly is poor: See video

    What could be the cause of this? Some thoughts I had:

    • It could have something to do with me not labeling occluded points as such for training the model. I label all points as visible even if they are occluded (on the back of the object etc)
    • The key-points could be inaccurate: the network-input is only 192px, which could be) too small for key-points at, for example, the buttons of the airfryer.
    • The airfryer object is too hard for a convolutional model to accurately be recognized: its black, very reflective and has only few features. I personally think that this is not the case though
    • There is a code-mistake somewhere
    • Projection-matrix (intrinisic camera calibration etc) is incorrect
    • The model itself is not accurate enough:
      • No generalization from synthetic data to real data? This is for sure something that needs to be done: domain randomization. Yet I expect the model to perform well enough on the synthetic data at least.
      • Not enough training data? I only use 6300 images for training whereas the ai_challenger dataset has >20.000 training images.
    • I did not train for enough steps: I had to cancel the training so I reached 113000 instead of the recommended amount of steps: num_train_samples * max_epoch' / batchsize * gpus = 6300 * 1000 / 8 = 787.500‬

    However, my predictions seem to doing well in Tensorboard: individualImage (1) individualImage (2)

    And the model seems to converge according to my loss:

    2019-07-04 09:59:45.240315: step 112970, loss = 105.70, last_heat_loss = 15.62 (42.6 examples/sec; 0.188 sec/batch)
    2019-07-04 09:59:51.029643: step 112980, loss = 123.71, last_heat_loss = 17.12 (54.1 examples/sec; 0.148 sec/batch)
    2019-07-04 09:59:57.532166: step 112990, loss = 96.85, last_heat_loss = 14.31 (57.2 examples/sec; 0.140 sec/batch)
    2019-07-04 10:00:03.783458: step 113000, loss = 113.13, last_heat_loss = 15.40 (51.3 examples/sec; 0.156 sec/batch)
    2019-07-04 10:00:26.010103: step 113010, loss = 115.02, last_heat_loss = 16.47 (55.2 examples/sec; 0.145 sec/batch)
    2019-07-04 10:20:58.271013: step 113020, loss = 92.60, last_heat_loss = 13.03 (53.3 examples/sec; 0.150 sec/batch)
    
    opened by jgcbrouns 3
  • 这段代码不太明白

    这段代码不太明白

    def __init__(self, idx, img_path, img_meta, annotations, sigma):
            self.idx = idx
            self.img = self.read_image(img_path)
            self.sigma = sigma
    
            self.height = int(img_meta['height'])
            self.width = int(img_meta['width'])
    
            joint_list = []
            for ann in annotations:
                if ann.get('num_keypoints', 0) == 0:
                    continue
    
                kp = np.array(ann['keypoints'])
                xs = kp[0::3]
                ys = kp[1::3]
                vs = kp[2::3]
    
                joint_list.append([(x, y) if v >= 1 else (-1000, -1000) for x, y, v in zip(xs, ys, vs)])
    
            self.joint_list = []
            transform = list(zip(
                [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13],
                [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13]
            ))
            for prev_joint in joint_list:
                new_joint = []
                for idx1, idx2 in transform:
                    j1 = prev_joint[idx1 - 1]
                    j2 = prev_joint[idx2 - 1]
    
                    if j1[0] <= 0 or j1[1] <= 0 or j2[0] <= 0 or j2[1] <= 0:
                        new_joint.append((-1000, -1000))
                    else:
                        new_joint.append(((j1[0] + j2[0]) / 2, (j1[1] + j2[1]) / 2))
                # background
                # new_joint.append((-1000, -1000))
                self.joint_list.append(new_joint)`
    
    首先非常感谢你的开源~ 其次我有几个小的问题,麻烦花您几分钟时间~
    为什么要调整热点顺序? 后面求两个点中心,这个好像没啥作用啊? 如何修改代码可以完成一个手的热区检测? 十分感谢~~
    opened by bailiqun 3
  • error occurs when convert ckpt to frozen pb.

    error occurs when convert ckpt to frozen pb.

    Hi, when I convert ckpt to frozen pb using the ckpt you provide, error happened! Here is the log information.

    2018-06-27 19:45:15.060637: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-06-27 19:45:15.169085: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2018-06-27 19:45:15.169470: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties: name: GeForce GTX 1070 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.683 pciBusID: 0000:01:00.0 totalMemory: 7.93GiB freeMemory: 7.06GiB 2018-06-27 19:45:15.169484: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0 2018-06-27 19:45:15.338374: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix: 2018-06-27 19:45:15.338418: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929] 0 2018-06-27 19:45:15.338425: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N 2018-06-27 19:45:15.338564: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 6819 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1070 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1) Traceback (most recent call last): File "./training/src/gen_frozen_pb.py", line 37, in saver = tf.train.Saver() File "/home/xxxx/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1338, in init self.build() File "/home/xxxx/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1347, in build self._build(self._filename, build_save=True, build_restore=True) File "/home/xxxx/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1372, in _build raise ValueError("No variables to save") ValueError: No variables to save

    opened by r1c7 3
  • Why use lambda instead of primitive type (like an integer) on network_mv2_hourglass.py

    Why use lambda instead of primitive type (like an integer) on network_mv2_hourglass.py

    Hi, I'm doing for building my own model by referencing your code and I have some questions.

    in trainting/src/network_mv2_hourglass.py image image

    1. Is it possible to use it like below instead of above?
    2. Is there any reason for the above code?
    net = slim.stack(net, inverted_bottleneck,
                         [
                             (6, 24, 1, 3),
                             (6, 24, 0, 3),
                             (6, 24, 0, 3),
                             (6, 24, 0, 3),
                             (6, 24, 0, 3),
                         ], scope="Conv2d_2")
    

    Thanks 😁

    opened by tucan9389 2
  • 数据增强 pose_crop_random是不是有问题

    数据增强 pose_crop_random是不是有问题

    @edvardHua 你好,很感谢你的代码,但是我有两点疑问,如下 pose_crop_random 函数如下:

    def pose_crop_random(meta): global _network_w, _network_h target_size = (_network_w, _network_h) for _ in range(50): x = random.randrange(0, meta.width - target_size[0]) if meta.width > target_size[0] else 0 y = random.randrange(0, meta.height - target_size[1]) if meta.height > target_size[1] else 0

        # check whether any face is inside the box to generate a reasonably-balanced datasets
        for joint in meta.joint_list:
            if x <= joint[CocoPart.RKnee.value][0] < x + target_size[0] and \
                    y <= joint[CocoPart.RKnee.value][1] < y + target_size[1] and \
                    x <= joint[CocoPart.RAnkle.value][0] < x + target_size[0] and \
                    y <= joint[CocoPart.RAnkle.value][1] < y + target_size[1] and \
                    x <= joint[CocoPart.LKnee.value][0] < x + target_size[0] and \
                    y <= joint[CocoPart.LKnee.value][1] < y + target_size[1] and \
                    x <= joint[CocoPart.LAnkle.value][0] < x + target_size[0] and \
                    y <= joint[CocoPart.LAnkle.value][1] < y + target_size[1]:
                break
    return pose_crop(meta, x, y, target_size[0], target_size[1])
    

    if条件是检测左右的膝盖和脚踝是否都在256的输入范围内,但是根据代码的意思,满足了这个条件就break了,break了内层循环,继续外层的50次循环。这个时候不是应该是找到了满意的x,y就应该直接调用pose_crop函数才对吗?

    另外还有第二个问题,只检查膝盖和脚踝这两个部位,条件充足吗?万一有的人的14个的点中其他位置超过了256输入的范围高斯图ground true怎么处理?丢弃还是什么?

    opened by sijun-zhou 2
  • Use validation dataset when 'pred_image_on_tensorboard'

    Use validation dataset when 'pred_image_on_tensorboard'

    I have customized and ran this project. One of the customized feature is that using validation dataset(ai_challenger_valid.json) when 'pred_image_on_tensorboard' on training.py. Could you review this feature after I PR?

    opened by tucan9389 2
  • Bump tensorflow-gpu from 1.4.0 to 2.7.2 in /training

    Bump tensorflow-gpu from 1.4.0 to 2.7.2 in /training

    Bumps tensorflow-gpu from 1.4.0 to 2.7.2.

    Release notes

    Sourced from tensorflow-gpu's releases.

    TensorFlow 2.7.2

    Release 2.7.2

    This releases introduces several vulnerability fixes:

    TensorFlow 2.7.1

    Release 2.7.1

    This releases introduces several vulnerability fixes:

    • Fixes a floating point division by 0 when executing convolution operators (CVE-2022-21725)
    • Fixes a heap OOB read in shape inference for ReverseSequence (CVE-2022-21728)
    • Fixes a heap OOB access in Dequantize (CVE-2022-21726)
    • Fixes an integer overflow in shape inference for Dequantize (CVE-2022-21727)
    • Fixes a heap OOB access in FractionalAvgPoolGrad (CVE-2022-21730)
    • Fixes an overflow and divide by zero in UnravelIndex (CVE-2022-21729)
    • Fixes a type confusion in shape inference for ConcatV2 (CVE-2022-21731)
    • Fixes an OOM in ThreadPoolHandle (CVE-2022-21732)
    • Fixes an OOM due to integer overflow in StringNGrams (CVE-2022-21733)
    • Fixes more issues caused by incomplete validation in boosted trees code (CVE-2021-41208)
    • Fixes an integer overflows in most sparse component-wise ops (CVE-2022-23567)
    • Fixes an integer overflows in AddManySparseToTensorsMap (CVE-2022-23568)

    ... (truncated)

    Changelog

    Sourced from tensorflow-gpu's changelog.

    Release 2.7.2

    This releases introduces several vulnerability fixes:

    Release 2.6.4

    This releases introduces several vulnerability fixes:

    • Fixes a code injection in saved_model_cli (CVE-2022-29216)
    • Fixes a missing validation which causes TensorSummaryV2 to crash (CVE-2022-29193)
    • Fixes a missing validation which crashes QuantizeAndDequantizeV4Grad (CVE-2022-29192)
    • Fixes a missing validation which causes denial of service via DeleteSessionTensor (CVE-2022-29194)
    • Fixes a missing validation which causes denial of service via GetSessionTensor (CVE-2022-29191)
    • Fixes a missing validation which causes denial of service via StagePeek (CVE-2022-29195)
    • Fixes a missing validation which causes denial of service via UnsortedSegmentJoin (CVE-2022-29197)
    • Fixes a missing validation which causes denial of service via LoadAndRemapMatrix (CVE-2022-29199)
    • Fixes a missing validation which causes denial of service via SparseTensorToCSRSparseMatrix (CVE-2022-29198)
    • Fixes a missing validation which causes denial of service via LSTMBlockCell (CVE-2022-29200)
    • Fixes a missing validation which causes denial of service via Conv3DBackpropFilterV2 (CVE-2022-29196)
    • Fixes a CHECK failure in depthwise ops via overflows (CVE-2021-41197)
    • Fixes issues arising from undefined behavior stemming from users supplying invalid resource handles (CVE-2022-29207)
    • Fixes a segfault due to missing support for quantized types (CVE-2022-29205)
    • Fixes a missing validation which results in undefined behavior in SparseTensorDenseAdd (CVE-2022-29206)

    ... (truncated)

    Commits
    • dd7b8a3 Merge pull request #56034 from tensorflow-jenkins/relnotes-2.7.2-15779
    • 1e7d6ea Update RELEASE.md
    • 5085135 Merge pull request #56069 from tensorflow/mm-cp-52488e5072f6fe44411d70c6af09e...
    • adafb45 Merge pull request #56060 from yongtang:curl-7.83.1
    • 01cb1b8 Merge pull request #56038 from tensorflow-jenkins/version-numbers-2.7.2-4733
    • 8c90c2f Update version numbers to 2.7.2
    • 43f3cdc Update RELEASE.md
    • 98b0a48 Insert release notes place-fill
    • dfa5cf3 Merge pull request #56028 from tensorflow/disable-tests-on-r2.7
    • 501a65c Disable timing out tests
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Bump tensorflow-gpu from 1.4.0 to 2.9.3 in /training

    Bump tensorflow-gpu from 1.4.0 to 2.9.3 in /training

    Bumps tensorflow-gpu from 1.4.0 to 2.9.3.

    Release notes

    Sourced from tensorflow-gpu's releases.

    TensorFlow 2.9.3

    Release 2.9.3

    This release introduces several vulnerability fixes:

    TensorFlow 2.9.2

    Release 2.9.2

    This releases introduces several vulnerability fixes:

    ... (truncated)

    Changelog

    Sourced from tensorflow-gpu's changelog.

    Release 2.9.3

    This release introduces several vulnerability fixes:

    Release 2.8.4

    This release introduces several vulnerability fixes:

    ... (truncated)

    Commits
    • a5ed5f3 Merge pull request #58584 from tensorflow/vinila21-patch-2
    • 258f9a1 Update py_func.cc
    • cd27cfb Merge pull request #58580 from tensorflow-jenkins/version-numbers-2.9.3-24474
    • 3e75385 Update version numbers to 2.9.3
    • bc72c39 Merge pull request #58482 from tensorflow-jenkins/relnotes-2.9.3-25695
    • 3506c90 Update RELEASE.md
    • 8dcb48e Update RELEASE.md
    • 4f34ec8 Merge pull request #58576 from pak-laura/c2.99f03a9d3bafe902c1e6beb105b2f2417...
    • 6fc67e4 Replace CHECK with returning an InternalError on failing to create python tuple
    • 5dbe90a Merge pull request #58570 from tensorflow/r2.9-7b174a0f2e4
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump numpy from 1.13.3 to 1.22.0 in /training

    Bump numpy from 1.13.3 to 1.22.0 in /training

    Bumps numpy from 1.13.3 to 1.22.0.

    Release notes

    Sourced from numpy's releases.

    v1.22.0

    NumPy 1.22.0 Release Notes

    NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

    • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
    • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
    • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
    • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
    • A new configurable allocator for use by downstream projects.

    These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

    The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

    Expired deprecations

    Deprecated numeric style dtype strings have been removed

    Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

    (gh-19539)

    Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

    numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

    (gh-19615)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Transferring an annotation file into COCO format

    Transferring an annotation file into COCO format

    You mentioned "I transfer the annotation into COCO format for using the data augument code from tf-pose-estimation repository." However, the repo "tf-pose-estimation" doesn’t exist. Would you please address this? Actually, I have my own data annotated and I need to transfer its format to COCO.

    opened by AzinPoshtyar 0
  • Using my own dataset how to define the keypoints in json file?

    Using my own dataset how to define the keypoints in json file?

    Hi, I got this running and training with the ai_challenger data and now I'd like to try some of my own data. Bu I don't quite understand the whole format for the ai_challenger_train.json file. For example in that file there are annotations, under annotations I find elements for each image. In those elements there is then a num_keypoints which seems to vary and I don't know why it isn't always 14 (some not visible maybe?). Then there is a keypoints list which is always 42 items long which looks to be 42/3 = 14 so I assume there are three items for each keypoint. For example:

    keypoints->[0] |->432 |->234 |->2

    I assume it goes: |->x |->y |->??

    I don't know what the last one, the 2 means. Is it a category or a depth of some kind or an indicator of what is visible or not? I'm really confused here. I think if I could figure out the formatting I could start training my own data and this is the last thing holding me up. Thank you for any help you can give.

    opened by esteimle 1
  • I don't know how to apply the newly trained model (.pb) to Android PoseMace.

    I don't know how to apply the newly trained model (.pb) to Android PoseMace.

    I don't know how to apply the newly trained model (.pb) to Android. to Android PoseMace.

    train.py -> xxx.meta / xxx.index / xxx.data -> gen_frozen_pb .py -> xxx.pb -> [Mace Library]converter.py -> mace.model???

    Is it correct to follow the steps below?

    For mobile phone performance, it must be driven by the mace library app.

    . pb file and then how to apply it to Android.

    opened by chartores 0
  • This is the question of how to change the code (human body[14 point]->human hand[21point])

    This is the question of how to change the code (human body[14 point]->human hand[21point])

    This is the question of how to change the code (human body[14 point]->human hand[21point])

    As shown in the post below, I have changed that part.

    1.dataset_augment.py

    • "class CocoPart(Enum)"
    • "def pose_flip(meta)" -> "flip_list"

    2.dataset_prepare.py

    • "def init" -> "transform = list(zip())"
    • "class CocoMetadata:" -> "__coco_parts = 21"

    I have a question. The human body is 14 points. The human hand is 21 points. So other things can be changed simply by numbers. But what regularity should this be and change?

    Below is the existing code. transform = list(zip( [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13], [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13] )) Then I changed it to new below. transform = list(zip( [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13, 15, 17, 19, 16, 18, 20, 21], [1, 2, 4, 6, 8, 3, 5, 7, 10, 12, 14, 9, 11, 13, 15, 17, 19, 16, 18, 20, 21] )) But I don't know if I did it correctly.

    opened by chartores 1
Owner
Focus on computer vision.
null
The example project of inferencing Pose Estimation using Core ML

This project is Pose Estimation on iOS with Core ML. If you are interested in iOS + Machine Learning, visit here you can see various DEMOs. 한국어 README

tucan9389 636 Dec 19, 2022
Real-Time image recognition for iOS with Vision(CoreML) and InceptionV3

Kesan-ML-iOS Real-Time image recognition for iOS with CoreML and InceptionV3  Test Flight Description Real-Time image recognition Integrating app wit

Ikmal Azman 3 Jun 26, 2022
Cardshark is an iOS card counting App that uses state of the art machine learning (YOLO) to classify and count the cards at real time.

Cardshark The game of Blackjack is one of the most popular casino games in the world. It is also the most winnable using a skill called Card Counting.

Eric Miao 1 Jan 23, 2022
iOS multi-functional AI camera: portrait cartoon, ageing and rejuvenation, beauty, filters, artistic effects, etc.

Magic Camera is an iOS AI camera app based on SwiftUI and CoreML that implements the following features: Portrait Cartoonization, which turns your photos into cartoon avatars Portrait Style Migration, which makes your photos older, younger, hair color, etc Beauty Camera, which supports peeling

William Wang 157 Dec 23, 2022
Classifying Images With Vision And Core ML

Classifying Images with Vision and Core ML Preprocess photos using the Vision framework and classify them with a Core ML model. Overview With the Core

Ivan Kolesov 2 Nov 15, 2022
JXA and swift code that can perform some macOS situational awareness without generating TCC prompts.

Spotlight Enumeration Kit Repo of Swift and JXA projects to leverage macOS Spotlight db data for the following: TCC folder permissions (TCC-Checker.js

Cedric Owens 27 Dec 5, 2022
Includes CreateML and other learning materials (day 26-35) in 100 days of SwiftUI

SwiftUI Day 26 to 35 Simulator.Screen.Recording.-.iPhone.12.-.2021-12-25.at.21.1

Vong Nyuk Soon 1 Dec 26, 2021
Holistically-Nested Edge Detection (HED) using CoreML and Swift

HED-CoreML Holistically-Nested Edge Detection (HED) using CoreML and Swift This is the repo for tutorial, that contains an example application that ru

Andrey Volodin 101 Dec 25, 2022
Photo Assessment using Core ML and Metal.

PhotoAssessment Photo Assessment (i.e. quality score) using Core ML and Metal. ?? Article 使用 Metal 和 Core ML 评价照片质量 Parallel Computation using MPS ??

杨萧玉 59 Dec 26, 2022
Text Classifier App for iOS, powered by Apple Vision & CreateML framework

Text Classifier App for iOS, powered by Apple Vision & CreateML framework

Ikmal Azman 2 Sep 15, 2022
Demo of iOS app that recognizes finger heart by machine learning

HandPoseClassificationAR Demo of iOS app that recognizes finger heart by machine learning How to build 1, Download or Clone this project and open in x

MLBoy 2 Jan 26, 2022
Demo of using TensorFlow Lite on iOS

TensorFlowLiteiOS Demo of using TensorFlow Lite on iOS Use the image classification model mobilenet_quant_v1_224. This is an excerpt and arrangement o

MLBoy 4 Jan 27, 2022
iOS Core ML implementation of waifu2x

waifu2x on iOS Introduction This is a Core ML implementation of waifu2x. The target of this project is to run waifu2x models right on iOS devices even

Yi Xie 469 Jan 8, 2023
This project is Text Recognition using Firebase built-in model on iOS

TextRecognition-MLKit This project is Text Recognition using Firebase built-in model on iOS. If you are interested in iOS + Machine Learning, visit he

tucan9389 80 Nov 17, 2022
MXNet to Core ML - iOS sample app

Bring Machine Learning to iOS apps using Apache MXNet and Apple Core ML

Amazon Web Services - Labs 54 Nov 9, 2022
A demo for iOS machine learning framework : Core ML

CoreMLDemo A demo for iOS machine learning framework : Core ML Only Xcode9 and above are supported. Model Places205-GoogLeNet comes from [Apple Machin

null 32 Sep 16, 2022
TextDetection-CoreML - This project is Text Detection on iOS using Vision built-in model

This project is Text Detection on iOS using Vision built-in model. If you are interested in iOS + Machine Learning, visit here yo

tucan9389 61 Nov 17, 2022
golf pose detection Analyzing golf pose with MLKit pose detection

golf-pose golf pose detection Analyzing golf pose with MLKit pose detection (PHI NETWORKS, 창의적통합설계, 2021) Standard & Frameworks iOS platform (Swift, R

Donghyun Lee 1 Jan 24, 2022
Summon is an Apple-watch app that let's a person summon another person to an exact location within a building

Summon is an Apple-watch app that let's a person summon another person to an exact location within a building.

André J 247 Dec 29, 2022
Pose Estimation on iOS with TensorFlow Lite

This project is Pose Estimation on iOS with TensorFlow Lite. If you are interested in iOS + Machine Learning, visit here you can see various DEMOs. 2D

tucan9389 125 Nov 28, 2022