Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
822 views
in Technique[技术] by (71.8m points)

dataset - How to convert .pck ( Python Pickle object ) files into .jpeg format

I have a dataset of knee bone MRI but it is in .pck format can anyone help me regarding converting it into the .jpeg format or .png

question from:https://stackoverflow.com/questions/65931143/how-to-convert-pck-python-pickle-object-files-into-jpeg-format

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you know what Python library was used to create or load the images that were saved as .pcks, yes.

You first need to load the pickle files as objects again using the pickle.load() method (documentation here) and then save them again using whatever library was used to make them in the first place. In the case of OpenCV, you would use the cv2.imwrite() method, for PIL it's Image.save(). If you aren't using those, just look up the documentation for whatever library you're using on saving images.

If you don't know what library was used to make the images, you'll have to see what the data you get after loading the file looks like before you can do anything else.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...