serve
serve copied to clipboard
Torchserve unable to handle cv2 images
🐛 Describe the bug
I did some image composition ie overlaying 1 image on top of other using cv2
After running this command I get different results on local vs torchserve -
cv2.imwrite("composited_image.png", composited_image)
Local machine result -

After running same code in torchserve -

Error logs
There are no error logs
Installation instructions
pip install torchserve
pip install torch-model-archiver
Model Packaing
MAR packaging works totally fine
config.properties
No response
Versions
pip freeze -
aiohttp==3.8.1
aiosignal==1.2.0
anyio==3.6.1
asgiref==3.5.2
async-timeout==4.0.2
asyncer==0.0.1
attrs==21.4.0
beautifulsoup4==4.11.1
black==22.6.0
boto3==1.24.33
botocore==1.27.33
brotlipy==0.7.0
certifi @ file:///opt/conda/conda-bld/certifi_1655968806487/work/certifi
cffi @ file:///opt/conda/conda-bld/cffi_1642701102775/work
charset-normalizer==2.0.12
click==8.0.3
cryptography @ file:///tmp/build/80754af9/cryptography_1652101588893/work
cycler==0.11.0
docopt==0.6.2
enum-compat==0.0.3
fastapi==0.72.0
filelock==3.7.1
filetype==1.0.9
flatbuffers==2.0
fonttools==4.34.2
frozenlist==1.3.0
future==0.18.2
gdown==4.4.0
h11==0.13.0
idna @ file:///tmp/build/80754af9/idna_1637925883363/work
imageio==2.19.3
imutils==0.5.4
jmespath==1.0.1
kiwisolver==1.4.3
llvmlite==0.38.1
marshmallow==3.15.0
matplotlib==3.5.2
mkl-fft==1.3.1
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626186066731/work
mkl-service==2.4.0
multidict==6.0.2
mypy-extensions==0.4.3
networkx==2.8.4
ninja==1.10.2.3
numba==0.55.2
numpy @ file:///opt/conda/conda-bld/numpy_and_numpy_base_1652801679809/work
onnxruntime==1.10.0
opencv-python==4.6.0.66
packaging==21.3
pathspec==0.9.0
Pillow==9.0.1
pipreqs==0.4.11
platformdirs==2.5.2
protobuf==4.21.2
psutil==5.9.1
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pydantic==1.9.1
PyMatting==1.1.5
pyOpenSSL @ file:///opt/conda/conda-bld/pyopenssl_1643788558760/work
pyparsing==3.0.9
PySocks @ file:///tmp/build/80754af9/pysocks_1605305812635/work
python-dateutil==2.8.2
python-multipart==0.0.5
PyWavelets==1.3.0
rembg==2.0.21
requests @ file:///opt/conda/conda-bld/requests_1657734628632/work
s3transfer==0.6.0
scikit-image==0.19.1
scipy==1.8.0
six @ file:///tmp/build/80754af9/six_1644875935023/work
sniffio==1.2.0
soupsieve==2.3.2.post1
starlette==0.17.1
tifffile==2022.5.4
tomli==2.0.1
torch==1.12.0
torch-model-archiver==0.6.0
torchaudio==0.12.0
torchserve==0.5.1
torchvision==0.13.0
tqdm==4.62.3
typing_extensions==4.3.0
urllib3==1.26.10
uvicorn==0.17.0
watchdog==2.1.7
yarg==0.1.9
yarl==1.7.2
zipp==3.7.0
Repro instructions
bash create_mar.sh
torchserve --start --ts-config torchserve.properties
Possible Solution
No response
@RutujaWanjari Can you please share the steps to repro the problem. How are you passing the image, what model you are using, the code you have written etc. Thanks
Please reopen the issue when you get a chance