Giter VIP home page Giter VIP logo

r-centernet's Issues

疑问

image

箭头框是车辆头尾图,1-2-3是labelimg2画的框
角度定义不明确,作者,你好,请在readme中详细定一下规则吧,tks

Compare with CenterNet.

Hi! I am very interested in your work, Do you compare the performance of R-CenterNet in AirPlane datasets with that of orignal CenterNet?

the differences with centerNet?

centerNet papers shows, predicting heatmap+center points+cornel points, as pic bellow, but the code just only regress the center points and boxes width and height ?

image

有人成功用torch script生成了pt模型吗

我用的piou+centerOBB, trace成功了模型 但是模型不对,看网上有人说应该用script 但script只支持python的子集 需要修改forward的代码,修改到DLAUp的getAttr(self, "proj_" + str(startp - i)) 这种代码就修改不下去了,因为script不支持动态函数,请教大神们有成功把centernet这一类的模型给成功script的吗 (不是用trace的哈),可否参考一下script修改的forward源码 谢谢!

img_size

How do I choose img_size for the model? Thanks you

如何用Libtorch调用生成的pt文件

我将骨干网络改成了resnet18,并成功生成了pt格式(如以下代码),但是在Libtorch上调用时出错了,我怀疑是不是模型的输出接口用的是列表的形式,在Libtorch中无法识别,请问有什么样的解决办法吗?

//python生成pt格式模型:
model = ResNet(18)
model.load_state_dict(torch.load("ResNet18_best.pth"))
model.to("cpu")
traced_script_module = torch.jit.trace(model,torch.ones(1,3,512,512), strict=False)
traced_script_module.save("1.pt")

//Libtorch调用代码
torch::jit::script::Module model;
model = torch::jit::load("./1.pt");

//Libtorch调用时显示的错误:
Assertion failed: idx < size(), file C:\b\windows\pytorch\c10/util/SmallVector.h, line 201

训练时图片缩小4倍

你好,感谢您的分享,请问训练时图片缩小4倍的考虑时什么呢?为了提高小目标的检测率吗?谢谢。

map计算

当种类训练,最终验证在evolations.py中怎么修改得到map的值

angle_loss无法收敛的原因,其他loss均收敛

使用不同backbone的情况下,在多种实验下表明,只有dla34_dcn的backbone的angle_loss可以收敛,其他backbone包括resdcn_50,101,以及dlav0_34,angle_loss均无法有效收敛,其他head的loss表现均不错,这个问题可能是什么?角度的量纲?感受野?还是?

角度是怎么定义的

角度是怎么定义的?
R-CenterNet-master/imgs/001.jpg
比如这张图,里面只有一个大飞机,对应的xml。
0.54
这里的0.54是啥,是什么和什么之间的夹角,最好用图画出来说明一下。这样才直观。

<annotation>
	<folder>img</folder>
	<filename>001.jpg</filename>
	<path>F:\CV\毕业设计\打标签\img\001.jpg</path>
	<source>
		<database>Unknown</database>
	</source>
	<size>
		<width>958</width>
		<height>808</height>
		<depth>3</depth>
	</size>
	<segmented>0</segmented>
	<object>
		<name>aircraft</name>
		<pose>Unspecified</pose>
		<truncated>0</truncated>
		<difficult>0</difficult>
		<robndbox>
			<cx>602.1491</cx>
			<cy>523.8509</cy>
			<w>93.0</w>
			<h>105.0</h>
			<angle>0.54</angle>
		</robndbox>
		<extra/>
	</object>
</annotation>

Problem of angle prediction

Thanks for you r code.
I have trained this model on my dataset, but when i predict the targets, the angle prediction turns to be zero.
Furthermore, the loss did not converge when epoch=100.
Please give some suggestions.

x0n= (x0 -x)*cosA -(y0 - y)*sinA + x

Thanks for your great work
In the file of predict.py, why use this equation?

x0n= (x0 -x)*cosA -(y0 - y)*sinA + x
y0n = (x0-x)*sinA + (y0 - y)*cosA + y

x1n= (x1 -x)*cosA -(y1 - y)*sinA + x
y1n = (x1-x)*sinA + (y1 - y)*cosA + y

x2n= (x2 -x)*cosA -(y2 - y)*sinA + x
y2n = (x2-x)*sinA + (y2 - y)*cosA + y

x3n= (x3 -x)*cosA -(y3 - y)*sinA + x
y3n = (x3-x)*sinA + (y3 - y)*cosA + y

关于角度的疑问

图片

centernet出来的是外接矩形,就是图片中蓝色框,然后角度是目标的倾斜角度(设为角度A)吗,然后是把蓝色的外接矩形的四个点根据目标中心旋转角度A吗?我看代码里面是这样

bbox annotation format?

Dear @ZeroE04 ,
Thank you for sharing your work.
I am not clear about the bbox annotation of your dataset. I guess it is in xc, yc, w, h, ang, but I do not know how w, h are measured, parallel to the image coordinates or from the cv2.minAreaRect?

def coco_box_to_bbox(box):

For my dataset

     rect = cv2.minAreaRect(hull)
     xc, yc = rect[0][0], rect[0][1]
     w, h = rect[1][0], rect[1][1]
     angle = rect[2]
     angle = ange_to_0_180(angle)
     rbbox = [xc, yc, w, h, angle]

So, with my bbox annotation, I do not have to use the coco_box_to_bbox function right?
Thank for your time.

训练HRSC2016数据集

大佬您好,我训练HRSC2016数据集最终train loss和val loss维持在4左右就不变了,测试了demo发现预测效果也不好。能指点一二吗?谢谢了

去掉ang后evalution代码报错

作者你好!我尝试使用这个工程去做行人检测,由于数据集问题,我去掉了旋转角,修改后可以正常训练模型,但是在模型评估阶段,我同样去掉了ang相关的内容,使用普通的iou。但是all_pre_num和num的输出都是0。我尝试去寻找哪里出了问题,在evalution.py文件的get_pre_ret函数中打印res = np.delete(res, 0, 0)之后得到的res=[],这是为什么呢?
我将修改之后的evalution和predict代码放在了csdn里:
https://blog.csdn.net/weixin_43786395/article/details/121322506?spm=1001.2014.3001.5501

如果您能有时间有时间浏览,将会非常感谢!!!

About the multiple categories in code

Dear Author:
When I use this code to train for multiple categories, I find the code in "dataset.py" about line 37 "self._valid_ids = [1]" .Does it need to be modified? For example, two categories, self._valid_ids = [1, 2].

代码数据读取部分

"bbox": [
506.5467,
124.2383,
62.0,
91.0,
3.3464944418634275
],
分别为目标中心点(x,y),以及宽度,长度,角度,角度是以12点钟为0°,顺时针旋转的角度
可是代码里面怎么还是和原版centernet解析x1,y1,x2,y2用的一样

        for k in range(num_objs):  # num_objs图中标记物数目  
            ann = anns[k]  # 第几个标记物的标签
            bbox, an = coco_box_to_bbox(ann['bbox']) 
            cls_id = int(self.cat_ids[ann['category_id']]) 
            bbox[:2] = affine_transform(bbox[:2], trans_output)    # 将box坐标转换到 128*128内的坐标
            bbox[2:] = affine_transform(bbox[2:], trans_output)
            bbox[[0, 2]] = np.clip(bbox[[0, 2]], 0, output_w - 1)  
            bbox[[1, 3]] = np.clip(bbox[[1, 3]], 0, output_h - 1)
            # 上面几行都是做数据扩充和resize之后的变换,不重要
            h, w = bbox[3] - bbox[1], bbox[2] - bbox[0]
            if h > 0 and w > 0:
                radius = gaussian_radius((math.ceil(h), math.ceil(w)))  
                radius = max(0, int(radius))
                ct = np.array([(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2], dtype=np.float32) 
                ct_int = ct.astype(np.int32) 
                draw_gaussian(hm[cls_id], ct_int, radius)
                wh[k] = 1. * w, 1. * h
                ang[k] = 1. * an
                ind[k] = ct_int[1] * output_w + ct_int[0]  
                reg[k] = ct - ct_int
                reg_mask[k] = 1
        ret = {'input': inp, 'hm': hm, 'reg_mask': reg_mask, 'ind': ind, 'wh': wh, 'ang':ang}

多类别训练问题

请问 多类别训练,除了更改num_classes变量,还需要更改其他的吗?

请问训练完成后如何进行detection

win10,显卡2080s,train.py训练正常,训练完成后运行predict出现错误。
Traceback (most recent call last):
File "D:/R-CenterNet-master/predict.py", line 237, in
output, dets, forward_time = process(images, return_time=True)
File "D:/R-CenterNet-master/predict.py", line 152, in process
output = model(images)
File "D:\Anaconda\envs\CenterNet2\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "./backbone\dlanet.py", line 610, in forward
ret[head] = self.getattr(head)(x)
File "D:\Anaconda\envs\CenterNet2\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\Anaconda\envs\CenterNet2\lib\site-packages\torch\nn\modules\container.py", line 91, in forward
input = module(input)
File "D:\Anaconda\envs\CenterNet2\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "D:\Anaconda\envs\CenterNet2\lib\site-packages\torch\nn\modules\conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: CUDA error: out of memory

关于类别计算问题

图片
大佬你好,我想问一下关于predict里面的tmp_c是指这次预测的类别么?为啥要这么计算呢?不应该直接是i么,属于哪个类别热力图就算哪个类别

dataset

The angle of my dataset is 0-180 or -90 to 90 ? thanks you

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.