Suspicious Pickle?

#2
by JohnEDSAR - opened

Hugging Face is flagging the .pt files as suspicious with the pickle scan. Possible to provide the weights without pickling?

You're a suspicious pickle.

The weights are just in .pt format, I haven't pickled them in any specific way... I guess I could convert them to another format, but I don't really know what the point is? Does HF do anything other than flag the files?

StephanST changed discussion status to closed
StephanST changed discussion status to open

but i do not know how to use this model.please help me, it is better to show me the demo code

but i do not know how to use this model.please help me, it is better to show me the demo code

@VitoCorleone111 I guess you didn't even try to open those two python scripts in the repo, it's clearly described at the beginning of the scripts.
like this: "Usage: python yolov8_video_inference.py <model_path> <input_video_path> <output_video_path> <slice_height> <slice_width> <overlap_height_ratio> <overlap_width_ratio>"
install package follow the requirements, replace the script name, model path, video path and etc. then the demo should be good to go

Note: requirements should be torch, numpy, opencv-python, ultralytics, sahi, supervision (or you can google [sahi], open its github repo, and follow its instructions to setup the environment)

@StephanST it would be great to add the inference snippet to the model card, they are often there to get people started easily (I also initially looked there)
we have security scanners in repositories, technically pytorch serialization format is based on pickle and any pytorch model could have custom functions inside that can be suspicious (see here), hence we have safetensors format which most libraries have adopted so far.

Hi,
I'd like to run this model on a DSP and need to convert it from PyTorch to DLC. The conversion SW looks like it needs the constants.pkl file, since this "...uses the default pickle module implicitly. It is possible to construct malicious pickle data..."

RuntimeError: PytorchStreamReader failed locating file constants.pkl: file not found

Can you please supply the constants.pkl file as part of the model?

Thank you for your time.

Sign up or log in to comment