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

EOD/eod/models/heads/utils/bbox_helper.py", line 341, in clip_bbox dw, dh = img_size[6], img_size[7] IndexError: list index out of range #2

Closed
lucasjinreal opened this issue Nov 1, 2021 · 5 comments

Comments

@lucasjinreal
Copy link

I found in Inferece.py the prepare are:

def fetch_single(self, filename):
        img = self.image_reader.read(filename)
        data = EasyDict(
            {"filename": filename, "origin_image": img, "image": img, "flipped": False}
        )
        data = self.transformer(data)
        scale_factor = data.get("scale_factor", 1)

        image_h, image_w = get_image_size(img)
        new_image_h, new_image_w = get_image_size(data.image)
        data.image_info = [
            new_image_h,
            new_image_w,
            scale_factor,
            image_h,
            image_w,
            data.flipped,
            filename,
        ]
        data.image = data.image.cuda()
        return data

which image_info max size is 7, so that above index [7] is out of indices. How to resolve?

@yqyao
Copy link

yqyao commented Nov 1, 2021

I found in Inferece.py the prepare are:

def fetch_single(self, filename):
        img = self.image_reader.read(filename)
        data = EasyDict(
            {"filename": filename, "origin_image": img, "image": img, "flipped": False}
        )
        data = self.transformer(data)
        scale_factor = data.get("scale_factor", 1)

        image_h, image_w = get_image_size(img)
        new_image_h, new_image_w = get_image_size(data.image)
        data.image_info = [
            new_image_h,
            new_image_w,
            scale_factor,
            image_h,
            image_w,
            data.flipped,
            filename,
        ]
        data.image = data.image.cuda()
        return data

which image_info max size is 7, so that above index [7] is out of indices. How to resolve?

https://github.com/ModelTC/EOD/blob/a45b74430070d82d9248a10fb5e1116bb7ababe1/eod/data/datasets/coco_dataset.py#L297. This is a bug for yolov5 (center pad) inference, we will fix it later

@LitPrice
Copy link
Contributor

LitPrice commented Nov 3, 2021

@jinfagang The bug has been fixed.

@lucasjinreal
Copy link
Author

@Joker-co can we have a demo.py sinply read a image as input and show result? Don't involve with any dataloader so that it can easily use and quickly vis final result.

@yqyao
Copy link

yqyao commented Nov 3, 2021

We think the demo now seems to be able to meet the demand. Config is necessary in order to parse the test configuration, and we don't build dataloader. @jinfagang

@lucasjinreal
Copy link
Author

lucasjinreal commented Nov 3, 2021

@yqyao something like this could be better, whole code easy to modification rather than deeply wrapped inside EOD package.

And this demo gives wrong result: Also doesn't preduce any result after postprocess

#3 (comment)

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

3 participants