Skip to content

Commit

Permalink
tmp save
Browse files Browse the repository at this point in the history
  • Loading branch information
dingjiansw101 committed Apr 26, 2019
1 parent 4db7aed commit d3f8da4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
12 changes: 6 additions & 6 deletions dota-v1.5_evaluation_task1.py
Expand Up @@ -261,13 +261,13 @@ def calcoverlaps(BBGT_keep, bb):

def main():

# detpath = r'/home/dingjian/data/DOTA-v1.5/example/RoITrans/Task1_{:s}.txt'
# annopath = r'/home/dingjian/code/DOAI_server2/media/DOTA15_Task1_gt/{:s}.txt'
# imagesetfile = r'/home/dingjian/code/DOAI_server2/media/testset.txt'
detpath = r'/home/dingjian/data/DOTA-v1.5/example/RoITrans/Task1_{:s}.txt'
annopath = r'/home/dingjian/code/DOAI_server2/media/DOTA15_Task1_gt/{:s}.txt'
imagesetfile = r'/home/dingjian/code/DOAI_server2/media/testset.txt'

detpath = r'PATH_TO_BE_CONFIGURED/Task1_{:s}.txt'
annopath = r'PATH_TO_BE_CONFIGURED/{:s}.txt' # change the directory to the path of val/labelTxt, if you want to do evaluation on the valset
imagesetfile = r'PATH_TO_BE_CONFIGURED/valset.txt'
# detpath = r'PATH_TO_BE_CONFIGURED/Task1_{:s}.txt'
# annopath = r'PATH_TO_BE_CONFIGURED/{:s}.txt' # change the directory to the path of val/labelTxt, if you want to do evaluation on the valset
# imagesetfile = r'PATH_TO_BE_CONFIGURED/valset.txt'

# For DOTA-v1.5
classnames = ['plane', 'baseball-diamond', 'bridge', 'ground-track-field', 'small-vehicle', 'large-vehicle', 'ship', 'tennis-court',
Expand Down
12 changes: 6 additions & 6 deletions dota-v1.5_evaluation_task2.py
Expand Up @@ -229,13 +229,13 @@ def voc_eval(detpath,
return rec, prec, ap

def main():
# detpath = r'/home/dingjian/data/DOTA-v1.5/example/RoITransTask2/Task2_{:s}.txt'
# annopath = r'/home/dingjian/code/DOAI_server2/media/DOTA15_Task2_gt/{:s}.txt'
# imagesetfile = r'/home/dingjian/code/DOAI_server2/media/testset.txt'
detpath = r'/home/dingjian/Documents/ODAI_DOTA/DOAI_2019/doai2019_submit/gwf_Task2_merge_2/Task2_{:s}.txt'
annopath = r'/home/dingjian/code/DOAI_server2/media/DOTA15_Task2_gt/{:s}.txt'
imagesetfile = r'/home/dingjian/code/DOAI_server2/media/testset.txt'

detpath = r'PATH_TO_BE_CONFIGURED/Task2_{:s}.txt'
annopath = r'PATH_TO_BE_CONFIGURED/{:s}.txt'# change the directory to the path of val/labelTxt, if you want to do evaluation on the valset
imagesetfile = r'PATH_TO_BE_CONFIGURED/valset.txt'
# detpath = r'PATH_TO_BE_CONFIGURED/Task2_{:s}.txt'
# annopath = r'PATH_TO_BE_CONFIGURED/{:s}.txt'# change the directory to the path of val/labelTxt, if you want to do evaluation on the valset
# imagesetfile = r'PATH_TO_BE_CONFIGURED/valset.txt'
# For DOTA v1.5
classnames = ['plane', 'baseball-diamond', 'bridge', 'ground-track-field', 'small-vehicle', 'large-vehicle', 'ship', 'tennis-court',
'basketball-court', 'storage-tank', 'soccer-ball-field', 'roundabout', 'harbor', 'swimming-pool', 'helicopter', 'container-crane']
Expand Down
27 changes: 21 additions & 6 deletions polyiou.cpp
Expand Up @@ -5,7 +5,7 @@
#include<cmath>
#include <vector>
using namespace std;
#define maxn 510
#define maxn 51
const double eps=1E-8;
int sig(double d){
return(d>eps)-(d<-eps);
Expand Down Expand Up @@ -41,8 +41,22 @@ int lineCross(Point a,Point b,Point c,Point d,Point&p){
//多边形切割
//用直线ab切割多边形p,切割后的在向量(a,b)的左侧,并原地保存切割结果
//如果退化为一个点,也会返回去,此时n为1
void polygon_cut(Point*p,int&n,Point a,Point b){
static Point pp[maxn];
//void polygon_cut(Point*p,int&n,Point a,Point b){
// static Point pp[maxn];
// int m=0;p[n]=p[0];
// for(int i=0;i<n;i++){
// if(sig(cross(a,b,p[i]))>0) pp[m++]=p[i];
// if(sig(cross(a,b,p[i]))!=sig(cross(a,b,p[i+1])))
// lineCross(a,b,p[i],p[i+1],pp[m++]);
// }
// n=0;
// for(int i=0;i<m;i++)
// if(!i||!(pp[i]==pp[i-1]))
// p[n++]=pp[i];
// while(n>1&&p[n-1]==p[0])n--;
//}
void polygon_cut(Point*p,int&n,Point a,Point b, Point* pp){
// static Point pp[maxn];
int m=0;p[n]=p[0];
for(int i=0;i<n;i++){
if(sig(cross(a,b,p[i]))>0) pp[m++]=p[i];
Expand All @@ -66,9 +80,10 @@ double intersectArea(Point a,Point b,Point c,Point d){
if(s2==-1) swap(c,d);
Point p[10]={o,a,b};
int n=3;
polygon_cut(p,n,o,c);
polygon_cut(p,n,c,d);
polygon_cut(p,n,d,o);
Point pp[maxn];
polygon_cut(p,n,o,c, pp);
polygon_cut(p,n,c,d, pp);
polygon_cut(p,n,d,o, pp);
double res=fabs(area(p,n));
if(s1*s2==-1) res=-res;return res;
}
Expand Down

0 comments on commit d3f8da4

Please sign in to comment.