save tracking results into csv file for oxuva long-term tracking dataset (from txt to csv)

2019-10-25 09:42:03

Official Tools: OxUvA long-term tracking benchmark [ECCV'18] [Github]

Project pagehttps://oxuva.github.io/long-term-tracking-benchmark/

import os
import numpy as np
import cv2
import time
import oxuva
import pdb # export PYTHONPATH="/home/wangxiao/THOR/long-term-tracking-benchmark-master/python:$PYTHONPATH" # txtPath = '/home/wangxiao/THOR/benchmark/results/OXUVA/Tracker/'
# txtFiles = os.listdir(txtPath) # csv_path = './oxuva_csv_results/' # for index in range(len(txtFiles)): # txtName = txtFiles[index]
# pointPosition = txtName.find('.')
# videoName = txtName[:pointPosition] # preds = np.loadtxt(txtPath + txtName, delimiter=',')
# preds = preds.tolist() # spacePosition = txtName.find('_')
# if spacePosition:
# obj =
# else:
# obj = txtName[spacePosition:spacePosition+] # preds_file = os.path.join(csv_path, '{}_{}.csv'.format(videoName, obj)) # tmp_preds_file = os.path.join(csv_path, '{}_{}.csv.tmp'.format(videoName, obj))
# with open(tmp_preds_file, 'w', encoding='utf-8-sig') as fp:
# pdb.set_trace() # oxuva.dump_predictions_csv(videoName, obj, preds, fp)
# os.rename(tmp_preds_file, preds_file) # pdb.set_trace() import json
import pdb
import cv2
import os
import pandas as pd
resultpath= '/home/wangxiao/tracking_results_oxuva/'
videopath="/home/wangxiao/dataset/OxUvA/images/test/"
videos=os.listdir(videopath)
txtFiles = os.listdir(resultpath) for i in range(len(videos)):
txtName = videos[i] + "_oxuva-baseline.txt"
preds = np.loadtxt(resultpath + txtName, delimiter=',') print("==>> txtName: ", txtName)
xmin=[]
xmax=[]
ymin=[]
ymax=[]
video_ids=[]
obj_ids=[]
frame_nums=[]
presents=[]
scores=[]
video_id=videos[i][:]
if(len(videos[i])==):
obj_id='obj0000'
elif(videos[i][-]==''):
obj_id='obj0001'
else:
obj_id='obj0002'
present='True'
score=0.5
# l=result['res'] imgs=os.listdir(videopath+videos[i]+'/')
imgs = np.sort(imgs)
# pdb.set_trace() image=cv2.imread(videopath+videos[i]+'/'+imgs[])
imgh=image.shape[]
imgw=image.shape[] for j in range(len(imgs)): # pdb.set_trace() x=preds[j][]
y=preds[j][]
w=preds[j][]
h=preds[j][] ## results relative to original image size.
x1=x/imgw
x2=(x+w)/imgw
y1=y/imgh
y2=(y+h)/imgh x1=round(x1,)
x2=round(x2,)
y1=round(y1,)
y2=round(y2,) frame=imgs[j][:] if(frame==''):
frame_num=
else:
frame_num=frame.lstrip('') xmin.append(x1)
xmax.append(x2)
ymin.append(y1)
ymax.append(y2)
video_ids.append(video_id)
obj_ids.append(obj_id)
frame_nums.append(frame_num)
presents.append(present)
scores.append(score) # pdb.set_trace() dataframe=pd.DataFrame({'video_id':video_ids,'object_id':obj_ids,'frame_num':frame_nums,'present':presents,\
'score':scores,'xmin':xmin,'xmax':xmax,'ymin':ymin,'ymax':ymax})
savepath='./oxuva_csv_results/' +videos[i][:]+'_'+obj_id+'.csv'
columns=['video_id','object_id','frame_num','present','score','xmin','xmax','ymin','ymax'] dataframe.to_csv(savepath,index=False,columns=columns,header=None) # pdb.set_trace()

========= Results

==

save tracking results into csv file for oxuva long-term tracking dataset (from txt to csv)的更多相关文章

  1. 关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset)

    关于视觉跟踪中评价标准的相关记录(The Evaluation of Visual Tracking Results on OTB-100 Dataset) 2018-01-22  21:49:17 ...

  2. ogr2ogr: Export Well Known Text (WKT) for one feature to a CSV file

    Perhaps you’re looking for this? ogr2ogr -f “CSV” “E:\4_GIS\NorthArkCartoData\UnitedStates\MO_wkt” “ ...

  3. C# - CSV file reader

    // ------------------------------------------------------------------------------------------------- ...

  4. SQL SERVER – Import CSV File Into SQL Server Using Bulk Insert – Load Comma Delimited File Into SQL Server

    CSV stands for Comma Separated Values, sometimes also called Comma Delimited Values. Create TestTabl ...

  5. Matlab Code for Visualize the Tracking Results of OTB100 dataset

    Matlab Code for Visualize the Tracking Results of OTB100 dataset 2018-11-12 17:06:21 %把所有tracker的结果画 ...

  6. [PowerShell Utils] Create a list of virtual machines based on configuration read from a CSV file in Hyper-V

    Hello everyone, this is the third post of the series. .   Background =============== In my solution, ...

  7. Qt Read and Write Csv File

    This page discusses various available options for working with csv documents in your Qt application. ...

  8. HBase import tsv,csv File

    一,HBase中创建table 表(liupeng:test)并创建 info ,contect 列簇 hbase(main):258:0> create "liupeng:Test& ...

  9. Python: Write UTF-8 characters to csv file

    To use codecs, we can write UTF-8 characters into csv file import codecs with open('ExcelUtf8.csv', ...

随机推荐

  1. powershell 远程下载并执行

    远程下载文件到本地并执行cmd.exe /c powershell.exe -ExecutionPolicy bypass -noprofile -windowstyle hidden (new-ob ...

  2. 为什么MES系统要定制化?看这三家汽车供应商的苦恼

    很多企业对于为什么要对MES系统进行选择和定制化很不理解,今天,小编通过一个故事给大家进行阐述—— 故事背景: 汽车电子行业的三家企业A,B,C. A是整车厂一级供应商,主要产品为汽车电子配电盒. B ...

  3. 面试题:什么叫B树

    B是balanced的意思 是在二叉查找树  树的基础上增加了平衡的性质   导致它不是  二叉树了,变成了多叉树,但是叉几路又有了限制  否则怎么平衡呢 一棵m阶B树(balanced tree o ...

  4. CSS 样式的使用方式、选择器

    在html中使用css的三种方式: 1.行内样式:同过元素的style属性来设置 <p style="font-size:20px; color:red">hello& ...

  5. java list map在初始化的时候添加元素

    List<String> list = new ArrayList<String>(){{ add("First Object"); add("S ...

  6. Prometheus学习笔记(4)什么是pushgateway???

    目录 一.pushgateway介绍 二.pushgateway的安装运行和配置 三.自定义脚本发送pushgateway 四.使用pushgateway的优缺点 一.pushgateway介绍 pu ...

  7. windows10安装redis

    下载 github上下载最新(或者你需要的版本)的redis安装包,下载地址如下: https://github.com/microsoftarchive/redis/releases 打开点击版本号 ...

  8. 源码查看Thread.interrupted()和Thread.currentThread().isInterrupted()区别

    JAVA线程状态.线程START方法源码.多线程.JAVA线程池.如何停止一个线程等多线程问题 这两个方法有点容易记混,这里就记录一下源码. Thread.interrupted()和Thread.c ...

  9. GC线程是不是守护线程

    是 线程的话分为守护线程和非守护线程(即用户线程) 只要当前JVM实例中尚存在任何一个非守护线程没有结束,守护线程就全部工作; 只有当最后一个非守护线程结束时,守护线程随着JVM一同结束工作,守护线程 ...

  10. 201671010426 孙锦喆 实验十四 团队项目评审&课程学习总结

    徐明锦 徐明锦 2 95 2019-06-30T14:54:00Z 2019-06-30T14:54:00Z 9 608 3472 28 8 4072 14.00 Clean Clean false ...