got数据文件夹格式
|-- GOT-10k/
|-- train/
| |-- GOT-10k_Train_000001/
| | ......
| |-- GOT-10k_Train_009335/
| |-- list.txt
|-- val/
| |-- GOT-10k_Val_000001/
| | ......
| |-- GOT-10k_Val_000180/
| |-- list.txt
|-- test/
| |-- GOT-10k_Test_000001/
| | ......
| |-- GOT-10k_Test_000180/
| |-- list.txt
数据标注描述
Each sequence folder contains 4 annotation files and 1 meta file. A brief description of these files follows (let N denotes sequence length):
- groundtruth.txt – An N×4 matrix with each line representing object location [xmin, ymin, width, height] in one frame.
- cover.label – An N×1 array representing object visible ratios, with levels ranging from 0~8.
- absense.label – An binary N×1 array indicating whether an object is absent or present in each frame.
- cut_by_image.label – An binary N×1 array indicating whether an object is cut by image in each frame.
- meta_info.ini – Meta information about the sequence, including object and motion classes, video URL and more.
Values 0~8 in file cover.label correspond to ranges of object visible ratios: 0%, (0%, 15%], (15%~30%], (30%, 45%], (45%, 60%], (60%, 75%], (75%, 90%], (90%, 100%) and 100% respectively.
使用shutil移动got10k文件夹
# -*- coding: utf-8 -*-
import shutil
import os
dst = r'C:\Users\lpf\Desktop\dataset\Got10k\train'
dst1 = r'd:/Learning_Data/BasicCode/move_file/c'
path = []
def Test1(rootDir, path):
list_dirs = os.walk(rootDir)
for root, dirs, files in list_dirs:
for d in dirs:
if d[-3]=='_':
# if d[-1]=='a':
s=os.path.join(root, d)
path.append(s)
# shutil.move(d,dst1)
# for f in files:
# print (os.path.join(root, f))
Test1(r"C:\Users\lpf\Desktop\dataset\Got10k", path)
def Test2(rootDir, path):
list_dirs = os.walk(rootDir)
for root, dirs, files in list_dirs:
for d in dirs:
# if d[-3]=='_':
# # if d[-1]=='a':
s=os.path.join(root, d)
path.append(s)
# Test1(r'd:\Learning_Data\BasicCode\move_file')
# print(path[0])
# shutil.move(path[0],dst)
images_path = []
for images in path:
Test2(images, images_path)
# break
print(images_path[0])
print(len(images_path))
print(images_path[-1])
count = 0
# images_path
for i in images_path:
shutil.move(i,dst)
count += 1
if count % 100 == 0:
print("已完成移动{}个文件......".format(count))
print("finish")
裁剪数据集,获取图像对
from os.path import join, isdir, exists
from os import listdir, mkdir, makedirs
import cv2
import numpy as np
import glob
from concurrent import futures
import s