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

How to visualize the output ? #17

Open
manansaxena opened this issue Jul 20, 2019 · 12 comments
Open

How to visualize the output ? #17

manansaxena opened this issue Jul 20, 2019 · 12 comments

Comments

@manansaxena
Copy link

Hi,
I am getting the segmentation output after running the test.py file on my in the wild images.
output -
{"image_id": 6, "category_id": 1, "score": 1.0, "segmentation": {"size": [720, 1280], "counts": "obh`01^f02N2OLiYO0\f0000kUW;"}

How are we supposed to visualize this ?

@sanshibayuan
Copy link

sanshibayuan commented Jul 23, 2019

you can try somethinig like this:

from pycocotools.coco import COCO

def demo_result(anno_file,seg_result,box_result):
	cocoGt = COCO(anno_file)
	cocoB=cocoGt.loadRes(box_result)
	cocoS=cocoGt.loadRes(seg_result)
	save_path = './'
	for i in range(len(cocoB.imgs.keys())):
		img = cocoB.imgs[list(cocoB.imgs.keys())[i]]
		I = io.imread("D:/Datasets/coco2017/val2017/"+ img['file_name'])
		# show original image
		plt.axis('off')
		plt.imshow(I)
		annIds = cocoB.getAnnIds(imgIds=img['id'], catIds=[], iscrowd=None)
		anns = cocoB.loadAnns(annIds)
		cocoB.showAnns(anns)	# show box
		annIds = cocoS.getAnnIds(imgIds=img['id'], catIds=[], iscrowd=None)
		anns = cocoS.loadAnns(annIds)
		cocoS.showAnns(list(anns))	# show segmentations
		plt.show()

@manansaxena
Copy link
Author

Hi,
What would be the box result in this case ?
Because I get output like this for three people in the images.
Thanks

@sanshibayuan
Copy link

Hi,
What would be the box result in this case ?
Because I get output like this for three people in the images.
Thanks

In this project you dont have box ouputs so you can comment the corresponding lines.

@ankitsharma07
Copy link

Hi,
What would be the box result in this case?
Because I get output like this for three people in the images.
Thanks

In this project you don't have box outputs so you can comment on the corresponding lines.

Hey! I tried this method but was unfortunate to not get the visualization. Did you get them?

@Xuan-YE
Copy link

Xuan-YE commented Sep 23, 2019

Hi,
I am getting the segmentation output after running the test.py file on my in the wild images.
output -
{"image_id": 6, "category_id": 1, "score": 1.0, "segmentation": {"size": [720, 1280], "counts": "obh`01^f02N2OLiYO0\f0000kUW;"}

How are we supposed to visualize this ?

Hi!
Do you solve this problem?
Could you show me some details about how to run it on my own images?
I'm very grateful to you!

@asmallcodedog
Copy link

Hi,
What would be the box result in this case ?
Because I get output like this for three people in the images.
Thanks

Hi,
I am getting the segmentation output after running the test.py file on my in the wild images.
output -
{"image_id": 6, "category_id": 1, "score": 1.0, "segmentation": {"size": [720, 1280], "counts": "obh`01^f02N2OLiYO0\f0000kUW;"}
How are we supposed to visualize this ?

Have you solved the problem?
I have the same question for you.thanks very much!

@manansaxena
Copy link
Author

manansaxena commented Sep 27, 2019

Yeah I did get them.
I multiplied the masks with the images before the encoding process.
But the results that I got were really poor and mostly incorrect.
The visualization is correct but to run this model on wild images a lot of modifications are required.
And it's difficult to tell which one is making this happen ...

@ManiaaJia
Copy link

@manansaxena @sanshibayuan @ankitsharma07 @Xuan-YE @asmallcodedog
Hello everyone, I am sorry to bother you.But I can't access the dataset address provided by the dataset repo. Could you download it for me or give me a link to download? Thanks a lot.

@azuic
Copy link

azuic commented Oct 29, 2019

Yeah I did get them.
I multiplied the masks with the images before the encoding process.
But the results that I got were really poor and mostly incorrect.
The visualization is correct but to run this model on wild images a lot of modifications are required.
And it's difficult to tell which one is making this happen ...

Did you set the values of the four field "area", "segmentation", "bbox", "iscrowd" to be None or simply not having them in the input annotations? Did you specify the "category_id" on creating the data ?

@asmallcodedog
Copy link

asmallcodedog commented Oct 30, 2019 via email

@manansaxena
Copy link
Author

I left them blank. Yes i did specify the category id - it should be the same as we are trying to detect skeleton/human in all images

@azuic
Copy link

azuic commented Oct 31, 2019

I left them blank. Yes i did specify the category id - it should be the same as we are trying to detect skeleton/human in all images

So basically you did like {..."bbox":None, "segmentation":None, ...}? I tried that but it seems like it is requiring me to input some values. By the way, did you fo model.forward() to perform the inference? I got some weird out of index error when calling this function

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

7 participants