当前位置:网站首页>CUB_ Visualization of key points in 200 bird dataset
CUB_ Visualization of key points in 200 bird dataset
2022-07-29 03:44:00 【G fruit】
Key point visualization
1. Key points of birds (15 individual ) The definition of (part/parts.txt)
1 back back
2 beak beak
3 belly abdomen
4 breast Crowns
5 crown chest
6 forehead The forehead
7 left eye The left eye
8 left leg Left leg
9 left wing left wing
10 nape neck
11 right eye Right eye
12 right leg right leg
13 right wing right wing
14 tail tail
15 throat throat
2. Documents of key information (1 Pictures 15 A key point ,part/part_locs.txt)
Every time 1 Yes 5 Column
The first 1 List the number of the picture , The first 2 List the number of key points , The first 3、4 List the abscissa and ordinate of key points , The first 5 Whether the list points are blocked (1 Indicates no occlusion )

3. The number and path of the picture (images.txt)
The first 1 List the number of the picture , The first 2 List the path of the picture

4. Key point visualization complete code
No comments here , I hope you can understand it by yourself
# -*- coding: utf-8 -*-
""" Created on Sat Jul 23 16:55:48 2022 @author: Chengguo """
from tqdm import tqdm
import cv2
from PIL import Image
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
def main():
all_imgs = "E:/DL/FGIR/CUB_200_2011/images.txt"
all_keypoints = "E:/DL/FGIR/CUB_200_2011/parts/part_locs.txt"
keypoint_names = "E:/DL/FGIR/CUB_200_2011/parts/parts.txt"
key_names = []
with open(keypoint_names,"r") as f1:
# There's a problem here , Can't show left and right
key_names = [i.split(" ")[-1][:-1] for i in f1.readlines()]
print(key_names)
keypoints = np.loadtxt(all_keypoints)
print(keypoints)
with open(all_imgs,"r") as f1:
img_dirs = f1.readlines()
# print(img_dirs)
pbar = tqdm(total= len(img_dirs))
for i, img_dir in enumerate(img_dirs):
pbar.update(1)
img_name = "E:/DL/FGIR/CUB_200_2011/images/"+img_dir.split(" ")[-1][:-1]
# print(img_name)
img = cv2.imread(img_name)
for j,k in enumerate(keypoints[i*15:(i+1)*15,2:-1]):
x,y=int(k[0]),int(k[1])
cv2.circle(img,(x,y),radius=2,color=(255,0,0),thickness=2)
cv2.putText(img,key_names[j], (x+1,y+1),cv2.FONT_HERSHEY_SIMPLEX,0.5,(0,255,255),1)
cv2.imshow('image', img)
cv2.waitKey(500)
cv2.destroyAllWindows()
pbar.close()
if __name__ == "__main__":
main()
5. Visualization results
Here the right wing is covered , Its coordinates are displayed in the upper left corner (0,0) spot




边栏推荐
- Anaconda offline installation environment
- 从2019 年开始,你一定停止使用了这个营销策略…
- three. JS Part 54 how to pass structure array to shader
- Environment configuration stepping pit during colab use
- "The programming is not standardized, and my colleagues are in tears!"
- 安装抓包证书
- Data too long for column 'xxx' at row 1 solution
- Configure vscade to realize ROS writing
- AI platform, AI midrange architecture
- What you see and think in Microsoft
猜你喜欢

Sleuth+Zipkin 来进行分布式服务链路的追踪

I.MX6U-驱动开发-2-LED驱动

Why BGP server is used in sunflower remote control? Automatic optimal route and high-speed transmission across operators

Microcomputer principle and interface technology

最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口

Simple code implementation of decision tree

Shutter start white screen

Flutter 启动白屏

1. Mx6u driver development-2-led driver

How to understand clock cycle and formula CPU execution time = number of CPU clock cycles / dominant frequency
随机推荐
Rdkit II: use rdkit screening to screen 2D pharmacophores of chemical small molecules
AI platform, AI midrange architecture
1.5 nn. Module neural network (III)
无法一次粘贴多张图片
从2019 年开始,你一定停止使用了这个营销策略…
Functions and comparison of repeaters, hubs, bridges, switches and routers
Excel拼接数据库语句
实例搭建Flask服务(简易版)
容斥原理
ROS-Errror:Did you forget to specify generate_ messages(DEPENDENCIES ...)?
Cannot paste multiple pictures at once
Kotlin companion object vs global function
Configure vscade to realize ROS writing
暴力递归到动态规划 01 (机器人移动)
Remote desktop connection error
Machine learning based on deepchem
1.4 nn. Module neural network (II)
KNN method predicts pregnancy, KNN principle simple code
3.2 model saving and loading
Shortcut key for adjusting terminal size in ROS