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. 19、localStorage.getItem得到的是[object Object] 的解决方案

    实现本地存储,避免刷新页面数据丢失: localStorage.setItem 只能存储字符串, 所以在储存的时候先将对象转换为字符串 localStorage.setItem("local ...

  2. 【总结】web工作代码分类整理(持续更新)

    文件.blob 文件下载失败,将Blob对象转换为Json,处理异常错误? 使用FileReader,核心代码: var reader = new FileReader() reader.onload ...

  3. linux下执行python 提示module找不到 要加入系统路劲才找得到

    linux/cmd中python路径导入ModuleNotFoundError: No module named 'xxx'   import osimport syscurPath = os.pat ...

  4. maven引入oracle驱动

    下载驱动: https://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html 例如我这边是1 ...

  5. jq 实现切换菜单选中状态

    点击导航菜单,切换选中状态 效果: 思路:首先获取选中的URL,再通过正则判断是否相同,相同就加上相应的属性,不相同就去除相应的属性. html代码 <div class="layui ...

  6. python爬取站长之家植物图片

    from lxml import etree from urllib import request import urllib.parse import time import os def hand ...

  7. Codeforces I. Producing Snow(优先队列)

    题目描述: C. Producing Snow time limit per test 1 second memory limit per test 256 megabytes input stand ...

  8. day002-Linux基础之常用基本命令讲解

    Linux系统一切皆命令 命令1:pwd 显示当前所在目录命令2:cd(change directory) 切换目录 cd / 回到根目录 cd .. 返回上一级命令3:ls 查看当前目录下的文件 l ...

  9. C# Chart 曲线(多曲线展示)

    //绑定显示曲线数据(Chart控件名:) //X轴标题 this.CurveChart.ChartAreas["ChartArea1"].AxisX.Title = " ...

  10. [Algorithm] 350. Intersection of Two Arrays II

    Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...