GangmingZhao / GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection

A simple version for graphfpn
MIT License
82 stars 11 forks source link

GraphFPN中输入变量的格式问题 #7

Open Idiom1999 opened 2 years ago

Idiom1999 commented 2 years ago

您好,我在调试fpn.py中的FPN类中遇到问题:请问变量img_metas的格式是什么?如果您能分享您的原始数据,我将十分感谢!992202340@qq.com def forward(self, inputs, img_metas): """Forward function.""" assert len(inputs) == len(self.in_channels)

sp_values = []

    sp_positions = []
    #sp_edges = []
    for i in range(len(img_metas)):
        img_meta = img_metas[i]
        filename = img_meta['ori_filename'][0:-4:1]
        for scale in range(4):
            filename = '/data1/zhaogangming/cob_train_'+str(4**(scale))+'_superpixel/'+filename
            #sp_value_name = filename+'value.npy'
            sp_position_name = filename+'position.npy'
            #sp_edge_name = filename+'edge.npy'
            if os.path.exists(sp_position_name):
               sp_positions.append(np.load(sp_position_name, allow_pickle=True))
               #sp_values.append(np.load(sp_value_name, allow_pickle=True))
               #sp_edges.append(np.load(sp_edge_name, allow_pickle=True))
            else:
               sp_positions.append([])
GangmingZhao commented 2 years ago

请查看cob中的superpixel处理方式,和mmdetection对img_metas的基础定义。

Idiom1999 commented 2 years ago

Is there a wrong reply to this account? Please do not copy to me.

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月30日(星期五) 中午1:50 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection] GraphFPN中输入变量的格式问题 (Issue #7)

请查看cob中的superpixel处理方式,和mmdetection对img_metas的基础定义。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Joazs commented 1 year ago

您好,请问我使用Slic超像素分割的方法构成节点。发现Slic超像素分割的方法并不能固定产生超像素个数,导致我无法进行批量训练。请问这个怎么解决?

GangmingZhao commented 1 year ago

一般是single image处理,或者定义一个max number,然后多余补0.

速冻鱼蛋 @.***> 于2023年3月27日周一 09:19写道:

您好,请问我使用Slic超像素分割的方法构成节点。发现Slic超像素分割的方法并不能固定产生超像素个数,导致我无法进行批量训练。请问这个怎么解决?

— Reply to this email directly, view it on GitHub https://github.com/GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7#issuecomment-1484326984, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3A4FGATSBZ5GVLEHFJKWLW6DTKLANCNFSM6AAAAAAQAC6J3U . You are receiving this because you commented.Message ID: <GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7/1484326984 @github.com>

Joazs commented 1 year ago

请问您是通过聚合超像素块来完成图节点池化操作的吗?如果是的话,请问是按照什么规则聚合超像素块呢?

GangmingZhao commented 1 year ago

相似度排序,然后合并距离最近的点,通过控制阈值,确保两两合并或四四合并。

速冻鱼蛋 @.***> 于2023年3月27日周一 16:01写道:

请问您是通过聚合超像素块来完成图节点池化操作的吗?如果是的话,请问是按照什么规则聚合超像素块呢?

— Reply to this email directly, view it on GitHub https://github.com/GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7#issuecomment-1484681868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3A4FAP57MGV7OIE4AJZZDW6FCPJANCNFSM6AAAAAAQAC6J3U . You are receiving this because you commented.Message ID: <GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7/1484681868 @github.com>

Joazs commented 1 year ago

这个合并操作是指对应的节点特征向量求平均吗?那么池化后的邻接矩阵如何获得? 我猜的是,你用的Graph-UNet的TopK池化方法,这样的话就可以很容易获得池化后的节点特征以及邻接矩阵。不知道我理解(猜)的对不对。。。

GangmingZhao commented 1 year ago

速冻鱼蛋 @.***> 于2023年3月27日周一 16:39写道:

这个合并操作是指对应的节点特征向量求平均吗?那么池化后的邻接矩阵如何获得? 我猜的是,你用的Graph-UNet的TopK池化方法,这样的话就可以很容易获得池化后的节点特征以及邻接矩阵。不知道我理解(猜)的对不对。。。

— Reply to this email directly, view it on GitHub https://github.com/GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7#issuecomment-1484737545, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3A4FHED3NVXLGJBK4W6OTW6FG3BANCNFSM6AAAAAAQAC6J3U . You are receiving this because you commented.Message ID: <GangmingZhao/GraphFPN-Graph-Feature-Pyramid-Network-for-Object-Detection/issues/7/1484737545 @github.com>

Joazs commented 1 year ago

然后是经过Graph-UNet的图上采样后,将每个节点特征向量再根据超像素分割的索引返回去每个超像素块吗?比如第一个节点特征向量就赋给第一个超像素内所有像素点。 实在不好意思,我水平有限,以及刚刚接触mmdetection。所以我就按照我读完论文后自己的理解问了一些问题。