Comments (5)
--input_json_file "panoptic_train2017.json"
--segmentations_folder "stuff_train2017_pixelmaps"
--output_json_file "my_folder"
--categories_json_file "~/panopticapi/panoptic_coco_categories.json"
--things_only
Your argument is things only but your segmentation PNG's are for stuff. Perhaps this is the issue?
If so set your segmentations_folder to the results of unzipping the panoptic_train2017.zip file.
Another guess would be to adjust the popping of the color category attribute here:
for category in d_coco['categories']:
if things_only and category['isthing'] != 1:
continue
category.pop('isthing')
try:
category.pop('color')
except:
pass
categories_coco_detection.append(category)
d_coco['categories'] = categories_coco_detection
The key error at this point in time indicates to me there is no need to remove the 'color' key of the current category dictionary. Thus I wrapped it in a try / except block.
from panopticapi.
Thank you very much. I was indeed reading from the wrong segmentation folder.
from panopticapi.
i meet another problem int panoptic2detection_coco_format.py funtion : convert_panoptic_to_detection_coco_format()
as follow:
with open(output_json_file, 'w') as f:
json.dump(d_coco, f)
display error:
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'0b7i51O001O1O1O2N4L2N00000000000000N2N2M3N200O100
i use python3.5 ; i have looked up some information and didn't solve it ; can you help ? thanks!
from panopticapi.
I'm not sure about this but try json.dumps(d_coco_). dumps is for strings I believe: https://realpython.com/python-json/
from panopticapi.
i meet another problem int
panoptic2detection_coco_format.py funtion : convert_panoptic_to_detection_coco_format()
as follow:with open(output_json_file, 'w') as f: json.dump(d_coco, f)
display error:
raise TypeError(repr(o) + " is not JSON serializable") TypeError: b'0b7i51O001O1O1O2N4L2N00000000000000N2N2M3N200O100
i use python3.5 ; i have looked up some information and didn't solve it ; can you help ? thanks!
- thanks: sover my problem : #7
- 'counts' is returned as binary in Python 3, decode it into a UTF8 string
for segm_info in annotation['segments_info']:
if things_only and categories[segm_info['category_id']]['isthing'] != 1:
continue
mask = (pan == segm_info['id']).astype(np.uint8)
mask = np.expand_dims(mask, axis=2)
mask=COCOmask.encode(np.asfortranarray(mask))[0]
# 'counts' is returned as binary in Python 3, decode it into a UTF8 string
mask['counts'] = mask['counts'].decode('utf8')
segm_info.pop('id')
segm_info['image_id'] = annotation['image_id']
segm_info['segmentation'] = mask
annotations_detection.append(segm_info)
- best way to solve problem: use python2
from panopticapi.
Related Issues (20)
- evaluation
- KeyError: 'color' when running panoptic2detection_coco_format.py HOT 2
- Instance ID encoding discrepancy HOT 1
- Detection to Panoptic Segmenetaion Converter creates blank images and no segmenetation coordinates HOT 1
- How to specify instance mask in coco panoptic annotation format?
- where I can get images info in JSON file for COCO2017 datasets?
- Panoptic To Segmentation Converter Bug
- How to create pixel wise class-agnostic image segmentation? HOT 1
- Error when extracting semantic segmentation json from panoptic segmentation json HOT 2
- overlapping between annotations HOT 3
- How to use the result of panoptic segmentation to caculate the evaluation result of PQ metric data?
- how to visualize results for panoptic segmentation on test set
- TypeError: Object of type int64 is not JSON serializable HOT 16
- panoptic_coco_categories.json not found
- Does this work also with polygones, or only with RLE format? HOT 1
- ZeroDivisionError: division by zero
- About the stuff categories annotation.
- convert custom dataset to panoptic coco format
- KeyError when using detection2panoptic_coco_format
- How to make a panoramic segmentation dataset that contains both thing and stuff? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from panopticapi.