-
Notifications
You must be signed in to change notification settings - Fork 5
API
ruitedk6 edited this page Jul 13, 2020
·
1 revision
You can call your own functions from the annotation tool by sending a POST request to /api/callAPI
. The request hast to contain a json with the attribute api_call
which corresponds to the desired function's name.
All other attributes will be the parameters when the function is called.
This is used already in:
- labelPicture
- labelWords
If you want to write your own state look at the above for inspiration.
- Write a function in
api.py
:
def foo(arg1):
...
- Send a request to
/api/callAPI
with this json:
{
"api_call": "foo",
"arg1": "bar"
}
- This will call in api.py:
foo(arg1=bar)