Hmmm, today, Vancouver's weather is cooling down a little bit. As
mentioned in my previous blog Detectron2
- 2, I received OpenCV
AI KIT yesterday. Today, let's try it out.
depthai_demo.py
successfully starts inquiring a depth image earlier than a color image,
and stops inquiring the depth image later than the color image. In order
to use both color image and depth image at the same time, we should make
sure both color image and depth image are successfully inquired at the
same frame index.
1 2 3 4
➜ results git:(main) ✗ ls color | wc -l 3736 ➜ results git:(main) ✗ ls depth | wc -l 3797
2.2 Results
2.1.1 Single Image
Let's take a look at my demo (yeah, I'm the player), the resultant
color image and depth image with index 1000.
For my FIRST blog Detectron2
- 1 has already demonstrated its stunning capability, I
NEVER thought I'll have a 2nd chance to write a 2nd
blog about detectron2.
We first extract a single image from a youtube video Dance Workout- EXO: Love Shot,
follow by Kkardio. The reasons why
we select this video are: there are two parts of the
video: - the left part
contains multiple front-facing dancers - the right part contains a single back-facing
fllower
2.1.1 Command Line for IUV
1 2 3 4 5 6 7 8 9 10 11 12
➜ DensePose git:(master) ✗ python apply_net.py show configs/densepose_rcnn_R_50_FPN_s1x.yaml ./pkl/IUV/R_50_FPN_s1x.pkl image.png dp_contour,bbox --output image_densepose_contour.png The checkpoint state_dict contains keys that are not used by the model: proposal_generator.anchor_generator.cell_anchors.{0, 1, 2, 3, 4} ~/.local/lib/python3.8/site-packages/torch/_tensor.py:585: UserWarning: floor_divide is deprecated, and will be removed in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). (Triggered internally at ../aten/src/ATen/native/BinaryOps.cpp:461.) return torch.floor_divide(self, other) ~/.local/lib/python3.8/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ../c10/core/TensorImpl.h:1292.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) ....../detectron2/projects/DensePose/densepose/vis/densepose_results.py:133: UserWarning: The following kwargs were not used by contour: 'cfg', 'texture_atlas', 'texture_atlases_dict' plt.contour(u, self.levels, extent=extent, **self.plot_args) ....../detectron2/projects/DensePose/densepose/vis/densepose_results.py:134: UserWarning: The following kwargs were not used by contour: 'cfg', 'texture_atlas', 'texture_atlases_dict' plt.contour(v, self.levels, extent=extent, **self.plot_args)
2.1.2 Command Line for CSE
It looks smpl_uvSnapshot_colors.jpg is
missing?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
➜ DensePose git:(master) ✗ python apply_net.py show configs/cse/densepose_rcnn_R_50_FPN_s1x.yaml ./pkl/CSE/R_50_FPN_s1x.pkl image.png dp_vertex,bbox -v [06/28 16:19:54 apply_net]: Loading config from configs/cse/densepose_rcnn_R_50_FPN_s1x.yaml [06/28 16:19:54 apply_net]: Loading model from ./pkl/CSE/R_50_FPN_s1x.pkl The checkpoint state_dict contains keys that are not used by the model: pixel_mean pixel_std proposal_generator.anchor_generator.cell_anchors.{0, 1, 2, 3, 4} [06/28 16:19:56 apply_net]: Loading data from image.png ~/.local/lib/python3.8/site-packages/torch/_tensor.py:585: UserWarning: floor_divide is deprecated, and will be removed in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). (Triggered internally at ../aten/src/ATen/native/BinaryOps.cpp:461.) return torch.floor_divide(self, other) ~/.local/lib/python3.8/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at ../c10/core/TensorImpl.h:1292.) return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode) [06/28 16:19:57 apply_net]: Processing image.png ~/.local/lib/python3.8/site-packages/torch/nn/functional.py:3609: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. warnings.warn( [06/28 16:19:58 apply_net]: Output saved to outputres.0001.png
2.1.3 Results
Dance Workout- EXO: Love Shot, follow by
Kkardio
Dense Pose Contour IUV
Dense Pose Continuous Surface
Embedding
From the CSE result, it's quite obvious that detectron2
Densepose CSE is able to tell the left leg from the right leg.
Back to Canada for around 1 month. It's the time for me to write
something. Good to know that PTI is released open
source a couple of days ago. Let's take a look at its performance today.
Sorry that I seriously have NO time to investigate the
details, having been busy in a robotic arm project. Therefore, a couple
of resultant images are displayed as follows to demonstrate PTI's performance.