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

BUG and Suggestion #3

Open
robertokcanale opened this issue Aug 2, 2022 · 8 comments
Open

BUG and Suggestion #3

robertokcanale opened this issue Aug 2, 2022 · 8 comments

Comments

@robertokcanale
Copy link

robertokcanale commented Aug 2, 2022

Hello,
I tried the repo, and I think I found a bug in the file google_utils.py which is probably not due to this repo per see, but to how the official yolov7 has been modified.

The line 19, function attempt _download, you should change to the following

def attempt_download(file, repo='WongKinYiu/yolov7'): # Attempt file download if does not exist file = Path(str(file).strip().replace("'", '').lower()) if not file.exists(): try: response = requests.get(f'https://api.github.com/repos/{repo}/releases').json() # github api for x in response: for key, value in x.items(): #print("Key: ", key) if key == "assets": assets = [n['name'] for n in x['assets']] # release assets if key == "tag_name": tag = x['tag_name'] # i.e. v1.0 except: # fallback plan assets = ['yolov7.pt'] tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]

image

Please let me know if you encountered the same problem, in the current branch (starting from a clean pull of the repo) and see if my suggested changes are correct (you can also delete the comment of course, just for debug)

@SanghyunPark01
Copy link

@robertokcanale Hi, I tried your fork repository(yolov7) using webcam. But, it appear RGB.
So I edit code detect_ros.py Line 130 img = np_img_resized.transpose((2, 0, 1))[::-1] to img = np_img_resized.transpose((2, 0, 1))
But, it still appears RGB.
How to convert RGB to BGR?

@lwttttt
Copy link

lwttttt commented Oct 6, 2022

@robertokcanale Hi, I tried your fork repository(yolov7) using webcam. But, it appear RGB. So I edit code detect_ros.py Line 130 img = np_img_resized.transpose((2, 0, 1))[::-1] to img = np_img_resized.transpose((2, 0, 1)) But, it still appears RGB. How to convert RGB to BGR?

why not just search for bgr in the github page, then you will find in Line 127, There appears a desired_encoding='bgr8',maybe u will get ur answer.
waiting for ur reply

@robertokcanale
Copy link
Author

@SanghyunPark01 you can look for tutorials such as this one https://note.nkmk.me/en/python-opencv-bgr-rgb-cvtcolor/
to understand how to convert RGB to BGR images, you just need to change the order of the channels (i.e. the depth element of the image matrix) and it will be easily done according to your application

@SanghyunPark01
Copy link

Thank you! @lwttttt @robertokcanale I solved it right away, but I couldn't erase reply.
Thanks for your help!

@zhangYQHBAU
Copy link

when I catkin_make in my rospackage, it showed that could not find a package configuration file provided by 'vision_msgs',how can I solve this problem,thank you !

@zhangYQHBAU
Copy link

how to make this required in our ros environment? thank you
)TQ J`S5FHJ7L9}WBJJRSS8

@robertokcanale
Copy link
Author

robertokcanale commented Apr 17, 2023 via email

@zhangYQHBAU
Copy link

sudo apt-get install ros-noetic-vision-msgs

On Mon, 17 Apr 2023, 17:14 zhangYQHBAU, @.> wrote: how to make this required in our ros environment? thank you [image: )TQ JS5FHJ7L9}WBJJRSS8] https://user-images.githubusercontent.com/112097400/232440381-bc2cfaad-3d53-41f4-954b-d27d02c500f1.png — Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN7AVVC3RLWP5OX7GTTOX6TXBUCW7ANCNFSM55JR5VHA . You are receiving this because you were mentioned.Message ID: @.>

Oh, thank you very much!

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

4 participants