Giter Site home page Giter Site logo

cornernet's Introduction

CornerNet

tensorflow

CornerNet: Training and Evaluation Code

Code for reproducing the results in the following paper:

CornerNet: Detecting Objects as Paired Keypoints
Hei Law, Jia Deng
European Conference on Computer Vision (ECCV), 2018

Getting Started

environment

tensorflow==1.10
python3.6

Our current implementation only supports GPU so you need a GPU and need to have CUDA installed on your machine.

Installing MS COCO APIs

You also need to install the MS COCO APIs.

cd <CornetNet dir>/data
git clone https://github.com/cocodataset/cocoapi.git 
cd <CornetNet dir>/data/coco/PythonAPI
make

Downloading MS COCO Data

  • Download the training/validation split we use in our paper from here (originally from Faster R-CNN)
  • Unzip the file and place annotations under <CornetNet dir>/data/coco
  • Download the images (2014 Train, 2014 Val, 2017 Test) from here
  • Create 3 directories, trainval2014, minival2014 and testdev2017, under <CornerNet dir>/data/coco/images/
  • Copy the training/validation/testing images to the corresponding directories according to the annotation files

Training and Evaluation

We provide the configuration file (CornerNet.json) and the model file (CornerNet.py) for CornerNet in this repo.

To train CornerNet:

python train.py

To use the trained model:

python test.py 

##In the next few days I will provide model parameters that are trained on coco.

cornernet's People

Contributors

makalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cornernet's Issues

Resize problem

Do we need to resize the pictures in the dataset to the same size(511*511)?

datasets management/coco datasets using

how to manage the datasets,the way following the directions are not useful
cannot run the code
btw can anyone tell me that how to use the coco datasets correctly
thanks

求解惑

File "F:\chen_code\CornerNet-master\utils\get_data.py", line 47, in read_from_disk
image=self.coco.read_img(queue[0])

File "./utils\init_data.py", line 145, in read_img
return img.astype(np.float32)

AttributeError: 'NoneType' object has no attribute 'astype'

OutOfRangeError (see above for traceback): RandomShuffleQueue '_1_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 10, current size 0)
好像数据这块儿出错了,改来改去还是不对,大佬能带下吗

Wrong implementation of focal loss

pos_loss=tf.reduce_sum(tf.log(pre) * tf.pow(pos_weight,2))
neg_loss=tf.reduce_sum(tf.pow((1-gt),4)*tf.pow(neg_weight,2)*tf.log((1-pre)))

tf.log(pre) in pos_loss and tf.log((1-pre) in neg_loss are wrong.

The loss doesn't change

@makalo Because I only could train on the 1080ti GPU, I set the batch size is 2. However the loss is around 18 the focal_loss is around 36. I want to know the loss when you trian the model

help me!

Traceback (most recent call last):
File "train.py", line 197, in
t.train_mult()
File "train.py", line 55, in train_mult
outs,test_outs=self.net.corner_net(next_imgs,next_tags_tl,next_tags_br,is_training=True)
File "/home/jk/Downloads/CornerNet-master/net/network.py", line 29, in corner_net
top_left_is,bottom_right_is=self.model.corner_pooling(hinge_is,256,256,is_training=is_training)
File "/home/jk/Downloads/CornerNet-master/net/model.py", line 61, in corner_pooling
top_pool=TopPool(top)
File "/home/jk/Downloads/CornerNet-master/module/corner_pooling.py", line 37, in TopPool
@tf.custom_gradient
AttributeError: module 'tensorflow' has no attribute 'custom_gradient'

请问这是什么问题啊大佬

Can you explain the code of gaussian_radius in the utils/transform.py

In your paper, it is said that 'We determine the radius by the size of an object by ensuring that a pair of points within the radius would generate a bounding box with at least tIoU with the ground-truth annotation'. I know what it means. However, I don't understand the actual implementation in your code. Can you explain it for us? It will be better if you add some annotations in the code.

是否达到论文效果

因为这个代码test有问题所以想知道您有测试过准确率吗,能达到原版的结果吗?

tok_k 函数理解

您好:
我在读代码中的tok_k函数的时候发现:

def top_k(heat,k=100):
    batch,h,w,c=heat.get_shape().as_list()
    heat=tf.reshape(heat,(batch,-1))
    k_value,k_index=tf.nn.top_k(heat,k)
    k_class=k_index//(h*w)
    k_position=k_index%(h*w)
    k_y=k_position//w#0 is also a cata
    k_x=k_position%w
    return k_value,k_position,k_class,k_y,k_x

这里c在最后一个维度的话,得到k_index之后再反推出k_class 时候感觉不是很对。我自己尝试发现channel维度在h和w之前这么算才是对的。请问有人能告诉我怎么理解比较对呢

The code implementation of the left_pool does not correspond to the source code

Thank you for your work.

I may find some little errors, as follows:

def LeftPool(inputs):
    #forward
    def forward(inputs):
        out=tf.expand_dims(tf.reduce_max(inputs,2),2)
        i=tf.constant(1)
        batch,h,w,c=inputs.get_shape().as_list()
        def cond(i,out):
            return i < w
        def body(i,out):
            d=tf.expand_dims(tf.reduce_max(inputs[:,:,i:,:],2),2)
            out=tf.concat((out,d),2)
            i = i + 1
            return i,out
        _,out = tf.while_loop(cond, body, [i,out],shape_invariants= [i.get_shape(), tf.TensorShape([batch,h,None,c])])
        return out
    for (int64_t ind = 1; ind < width; ++ind) {
        input_temp  = input.select(3, width - ind - 1);
        output_temp = output.select(3, width - ind);
        max_temp    = output.select(3, width - ind - 1);

        at::max_out(max_temp, input_temp, output_temp);
    }

The source code shows that the left_pool is from the right to left, but the code implementation of the LeftPool is from left to right.
I think these two implementation methods have different sense. Meanwhile, the other pools also have the same question.
Looking forward to your reply :)

How to use your test.py

@makalo I have trained a model, but your test code is hard for me. So could you share a demo how to use the Class Test.
Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.