Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
857 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...