In [2]:import json
In [3]: jd_gt = json.load(open('pascal_test2007.json'))
In [4]: jd_gt['annotations'][0]
Out[4]:{'segmentation':[[47,239,47,371,195,371,195,239]],'area':19536,'iscrowd':0,'image_id':1,'bbox':[47,239,148,132],'category_id':12,'id':1,'ignore':0}
print(len(jd_gt['annotations']))
ann_gt1 =[a for a in jd_gt['annotations']if a['iscrowd']==0]print(len(ann_gt1))
ann_gt2 =[a for a in jd_gt['annotations']if a['ignore']==0]print(len(ann_gt2))
Out[]:149761497612032
defforward(self, images, features, targets=None):
self.dug_eval_gt =True
cls_logits = self.head(features)
locations = self.compute_locations(cls_logits, strides=self.loc_strides)if self.training:return self._forward_train(locations, cls_logits, targets)else:if self.dug_eval_gt:# test on ground-truthreturn eval_gt(self, locations, targets, images, cls_logits)return self._forward_test(self.loc_strides, cls_logits, images.image_sizes)defeval_gt(self, locations, targets, images, cls_logits):
targets =[t.to(locations[0].device)for t in targets][t.add_field("scores", torch.ones(len(t.bbox)))for t in targets]
res = targets,{}return res
修改配置文件中的TEST为 voc_2007_test_cocostyle
DATASETS:TRAIN: ("voc_2007_train_cocostyle","voc_2007_val_cocostyle","voc_2012_train_cocostyle", "voc_2012_val_cocostyle")
TEST: ("voc_2007_test_cocostyle",)
SOLVER:CHECKPOINT_PERIOD:7500TEST_ITER:1 # change here to enter test mode as soon.OUTPUT_DIR: ./outputs/pascal/gau/base_LD2.4 # base_LD1
len_boxes1, len_boxes2 =0,0def__getitem__(self, idx):global len_boxes1, len_boxes2
......
anno =[obj for obj in anno if obj["iscrowd"]==0]# ######################### add by hui ####################################if anno and"ignore"in anno[0]:# filter ignore out
anno =[obj for obj in anno ifnot obj["ignore"]]###########################################################################......
target = target.clip_to_image(remove_empty=True)......return img, target, idx
gt_dataset = COCODataset(gt_file, image_root,False)print(len(gt_dataset.coco.anns))
num_box =0for i in tqdm(range(len(gt_dataset))):
img, target, idx = __getitem__(gt_dataset, i)
num_box +=len(target.bbox)print(num_box, len_boxes1, len_boxes2)
Out[]:14976120321497612032
经过详细排查,正式前面说到的"ignore"字段有些目标不为0, "iscrowd"所有目标都是0
print(len(jd_gt['annotations']))
ann_gt1 =[a for a in jd_gt['annotations']if a['iscrowd']==0]print(len(ann_gt1))
ann_gt2 =[a for a in jd_gt['annotations']if a['ignore']==0]print(len(ann_gt2))
Out[]:149761497612032
#!/bin/bash
#
# Script to start LVS DR real server.
# description: LVS DR real server
#
#. /etc/rc.d/init.d/functions
VIP=10.10.6.252
host='/bin/hostname'
case "$1" in
sta
大多数java开发者使用的都是eclipse,今天感兴趣去eclipse官网搜了一下eclipse.ini的配置,供大家参考,我会把关键的部分给大家用中文解释一下。还是推荐有问题不会直接搜谷歌,看官方文档,这样我们会知道问题的真面目是什么,对问题也有一个全面清晰的认识。
Overview
1、Eclipse.ini的作用
Eclipse startup is controlled by th
import java.util.Arrays;
/**
* 最早是在陈利人老师的微博看到这道题:
* #面试题#An array with n elements which is K most sorted,就是每个element的初始位置和它最终的排序后的位置的距离不超过常数K
* 设计一个排序算法。It should be faster than O(n*lgn)。
原网页被墙,放这里备用。 MySQLdb User's Guide
Contents
Introduction
Installation
_mysql
MySQL C API translation
MySQL C API function mapping
Some _mysql examples
MySQLdb