|
from handler import EndpointHandler |
|
|
|
|
|
my_handler = EndpointHandler() |
|
|
|
|
|
embedding_input = { |
|
"inputs": { |
|
"batch": [ |
|
{ |
|
"image": "https://lp2.hm.com/hmgoepprod?set=source[/23/ab/23ab27480dd2dfc7007745402d3b8caaf756ee70.jpg],origin[dam],category[],type[DESCRIPTIVESTILLLIFE],res[m],hmver[2]&call=url[file:/product/style]", |
|
"description": "test", |
|
} |
|
] |
|
}, |
|
"type": "embedd", |
|
} |
|
classify_input = { |
|
"inputs": { |
|
"candidates": [ |
|
"Bohemian", |
|
"Vintage", |
|
"Streetwear", |
|
"Preppy", |
|
"Minimalist", |
|
"Glamorous", |
|
"Punk", |
|
"Romantic", |
|
"Classic", |
|
"Avant-garde", |
|
"Grunge", |
|
"Retro", |
|
"Gothic", |
|
"Hippie", |
|
"Eco-friendly", |
|
], |
|
"image": "https://static.zara.net/assets/public/bb1f/0983/a29f44e18ec9/3b7dd5791c67/05575420427-e1/05575420427-e1.jpg?ts=1708614949903&w=1126", |
|
}, |
|
"type": "classify", |
|
} |
|
|
|
|
|
embedd_pred = my_handler(embedding_input) |
|
classify_pred = my_handler(classify_input) |
|
|
|
|
|
print("embedd_pred", embedd_pred) |
|
print("classify_pred", classify_pred) |
|
|