The server
of OldVis image taxonomy labeler.
This server is shared by the web clients in client-label and client-compare.
- Under directory
./server
, executepoetry install
to install dependencies (assuming Python 3.10 and Poetry have been installed). - Under directory
./server/static
, executepoetry run setup_samples.py
. - Under directory
./server
, executepoetry run python server.py
.
Note: The steps above have the same effect as executing Step 1.1 Option 2, Step 1.2, Step 1.3, and Step 2 described in How to Use.
To use the server
, please follow the steps below.
Use oldvis_dataset to download the image resources and store it to ./static/images/
.
from oldvis_dataset import visualizations, fetch_images
visualizations.download(path="./static/visualizations.json")
fetch_images(metadata_path="./static/visualizations.json", img_dir="./static/images/")
Warning
The image download can be very slow and take days.
A sample of 400 images are available at oldvis/image-taxonomy.
Download these images and store at ./static/images/
.
Unzip ./static/thumbnails.zip
and store the unzipped images at ./static/thumbnails/
.
Unzip ./static/embeddings.zip
and store the unzipped embeddings.jsonl
at ./static/embeddings.jsonl
.
Before launching the server, make sure you have Python 3.10 and Poetry installed.
To launch the server, you need to:
poetry install
poetry run python server.py
If you see the following output, the server is successfully launched 🚀.
* Serving Flask app 'server'
...
To verify the server is working and the resources are correctly set up, you can try to access the following URL in your browser: http://localhost:5001/uuids/7ded1f58-a160-5127-a994-46797eca8e9a/image
.
If you see an image of a chart, the server is working as intended 🎉.
The server provides the following API services.
Method | URL | Description | Used By |
---|---|---|---|
GET | /ping |
Returns pong . Used for checking the availability of the server. |
/ |
GET | /uuids/<uuid>/image |
Returns the image (original size) with the given UUID. | client-label and client-compare |
GET | /uuids/<uuid>/thumbnail |
Returns the image thumbnail with the given UUID. | client-label and client-compare |
GET | /uuids/<uuid>/caption |
Returns the caption of the image with the given UUID. | / |
POST | /captioning |
Returns the captions of the images with the given UUIDs. | client-label |
POST | /clustering |
Returns the cluster labels of the images with the given UUIDs. | client-label |
POST | /findCenter |
Returns the UUID of the image that is closest to the center of the given images. | client-label |
POST | /findCenters |
Returns the UUIDs of the images that are closest to the centers of the given image groups. | client-label |
POST | /assignGrid |
Returns the cell indices of the images in the grid with the given number of rows and cols. | client-label and client-compare |