Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,请问这个支持多个类别识别吗? 我拿自己多类别的数据集训练的模型,检测的时候发现他的预测值返回类别都是2.0。如何解决呀? #3

Open
lareina115 opened this issue Sep 3, 2020 · 9 comments

Comments

@lareina115
Copy link

No description provided.

@lareina115 lareina115 changed the title def merge_outputs(detections):####################################### results = {} num_classes = 10 max_obj_per_img = 100#100 print("detections",detections) #for j in range(1, num_classes + 1): # results[j] = np.concatenate([results[j] for results in detections], axis=0).astype(np.float32) scores = np.hstack([detections[j][:, 5] for j in range(1, num_classes + 1)]) if len(scores) > max_obj_per_img: kth = len(scores) - max_obj_per_img thresh = np.partition(scores, kth)[kth] for j in range(1, num_classes + 1): keep_inds = (detections[j][:, 5] >= thresh) detections[j] = detections[j][keep_inds] return detections 你好,请问这个支持多个类别识别吗? 我拿自己多类别的数据集训练的模型,检测的时候发现他的预测值返回类别都是2.0。如何解决呀? Sep 3, 2020
@ZeroE04
Copy link
Owner

ZeroE04 commented Sep 9, 2020

支持。如果检测多类别,把代码里面num_classes都改成你的类别数目;然后再画框的地方,把画框的颜色自己调整一下,使不同类别颜色不同,我现在只用了一种颜色的框,也就是demo里面红蓝色的框。当然,你打标签的时候就得按照多类别来打

@pengyang1225
Copy link

你是怎么改修的? cpp 文件的需要修改吗?

@ZeroE04
Copy link
Owner

ZeroE04 commented Oct 21, 2020

你是怎么改修的? cpp 文件的需要修改吗?

不需要,修改python中代码

@zhaowendao30
Copy link

你好,请问你问题解决了吗?我这多类别预测也都是2

1 similar comment
@zwb170010
Copy link

你好,请问你问题解决了吗?我这多类别预测也都是2

@zhaowendao30
Copy link

zhaowendao30 commented Aug 26, 2021 via email

@singlestrong
Copy link

将他模型中的hm参数改为2,还有数据加载和解码中的num_class改为2就行

------------------ 原始邮件 ------------------ 发件人: "ZeroE04/R-CenterNet" @.>; 发送时间: 2021年8月25日(星期三) 上午9:54 @.>; @.@.>; 主题: Re: [ZeroE04/R-CenterNet] 你好,请问这个支持多个类别识别吗? 我拿自己多类别的数据集训练的模型,检测的时候发现他的预测值返回类别都是2.0。如何解决呀? (#3) 你好,请问你问题解决了吗?我这多类别预测也都是2 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

请问多目标训练后,map是怎么得到的,怎么修改evaluation.py文件呐

@JiliuLiSU
Copy link

多类别预测是2的原因是predict.py代码有问题,改hm参数、num_class都没有用

@7777fsq
Copy link

7777fsq commented Sep 14, 2023

多类别预测是2的原因是predict.py代码有问题,改hm参数、num_class都没有用

那请问应该怎么调整呢~~

哦 在predict.py里也有两处num_classes 也需要修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants