Slackbot
04/26/2023, 8:39 PMsauyon
04/26/2023, 8:41 PMMultipartEncoder
?Li Yi
04/26/2023, 8:43 PMmultipart/form-data; boundary=b67d737b1cc94a55a76d95da35648314
Is this what you are suggesting?sauyon
04/26/2023, 8:43 PMLi Yi
04/26/2023, 8:54 PMres = <http://requests.post|requests.post>(
"<http://0.0.0.0:3000/predict>", data=m, headers={"Content-Type": m.content_type}
)
If not, can you show me an example of how to specify the content type in the image? For example, my content type is image/jpeg.sauyon
04/26/2023, 8:54 PMm = MultipartEncoder(
fields={
"image": ('abc.jpg', open("/projects/ff_project/users/ff_li/_nasHome/project/ff-lib/bento/abc.jpg", "rb"), 'image/jpeg'),
"img_type":('', 'mic'),
"bbox": ('', '[0,0,100,100]'),
}
)
Li Yi
04/26/2023, 8:58 PMsauyon
04/26/2023, 9:01 PMLi Yi
04/26/2023, 9:06 PMsauyon
04/26/2023, 9:07 PMLi Yi
04/26/2023, 9:08 PMsauyon
04/26/2023, 9:08 PMLi Yi
04/26/2023, 9:12 PMcurl -X POST -H "Content-Type: multipart/form-data" -F image=@/projects/ff_project/users/ff_li/_nasHome/project/ff-lib/bento/abc.jpg -F img_type='mic' -F bbox='[0,0,100,100]' <http://0.0.0.0:3000/predict>
sauyon
04/26/2023, 9:14 PMLi Yi
04/26/2023, 9:14 PM