-
Notifications
You must be signed in to change notification settings - Fork 1
/
sender.py
41 lines (34 loc) · 870 Bytes
/
sender.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import requests
import config
def get(url):
return requests.get(url)
def post(url, data):
requests.post(url=url, json=data)
def preview_fiftyone(name):
get(
url = f'{config.url}:{config.port["flask"]}/fiftyone/{name}'
)
def preview_embedding(name):
get(
url = f'{config.url}:{config.port["flask"]}/embedding/{name}'
)
def compute(name):
post(
url = f'{config.url}:{config.port["flask"]}/compute',
data = {
'name' : name
}
)
def fiftyone_load(name, ids):
post(
url = f'{config.url}:{config.port["flask"]}/fiftyone/load',
data = {
'name' : name,
'ids' : ids
}
)
if __name__ == '__main__':
compute('quickstart')
preview_embedding('quickstart')
preview_fiftyone('quickstart')
# fiftyone_load('quickstart', [''])