Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add POST /predict method in joligen_api #507

Closed
wants to merge 42 commits into from

Conversation

alx
Copy link
Contributor

@alx alx commented Jul 7, 2023

joligen_api now supports a new HTTP POST endpoint on /predict route.

Predict options should be specified in {¨predict_options¨: { __OPTIONS_HERE__}} data json.

Currently, launch_predict method from scripts/gen_single_image.py will be used.

@beniz beniz requested a review from Bycob August 4, 2023 09:35
from util.util import MAX_INT


class PredictOptions(TrainOptions):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it doesn't work if PredictOptions only inherits BaseOptions, this will be fixed in future PR

server/joligen_api.py Outdated Show resolved Hide resolved
server/joligen_api.py Outdated Show resolved Hide resolved
server/joligen_api.py Outdated Show resolved Hide resolved
@alx
Copy link
Contributor Author

alx commented Sep 11, 2023

inference curl examples:

curl 'http://$JOLIGEN_SERVER/predict' -X POST \
  --data-raw '{"predict_options":{"model-in-file":"/data1/joligan/checkpoints/horse2zebra/latest_net_G_A.pth","img-in":"/data1/joligan/datasets/public/horse2zebra/trainA/n02381460_1006out.jpg","img-out":"/data1/joligan/datasets/public/horse2zebra/trainA/n02381460_1006out.out.jpg","gpu_ids":[2]}}'
curl 'http://$JOLIGEN_SERVER/predict' -X POST \
  --data-raw '{"predict_options":{"model-in-file":"/data1/joligan/checkpoints/VITON-HD/latest_net_G_A.pth","img-in":"/data1/joligan/datasets/public/horse2zebra/trainA/n02381460_1027.jpg","img-out":"/data1/joligan/datasets/public/horse2zebra/trainA/n02381460_1027.out.jpg","gpu_ids":[2]}}'

@alx
Copy link
Contributor Author

alx commented Oct 12, 2023

PR moved to Bycob#1

@alx alx closed this Oct 12, 2023
@alx alx deleted the feat_api_predict branch December 11, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants