Scene Recognition

The scene recognition api classifies an image into one of 365 scenes

To use this API, you need to enable the scene API when starting DeepStack

Starting DeepStack on Docker

Below we start DeepStack with only the Scene API enabled.

CPU Version
GPU Version
sudo docker run -e VISION-SCENE=True -v localstorage:/datastore -p 80:5000 \
deepquestai/deepstack
sudo docker run --rm --runtime=nvidia -e VISION-SCENE=True -v localstorage:/datastore \
-p 80:5000 deepquestai/deepstack:gpu

Basic Parameters

-e VISION-DETECTION=True This enables the scene API, all apis are disabled by default.

-v localstorage:/datastore This specifies the local volume where deepstack will store all data.

-p 80:5000 This makes deepstack accessible via port 80 of the machine.

Starting DeepStack on Raspberry PI

sudo deepstack start "VISION-SCENE=True"

Starting DeepStack on Windows

Start the DeepStack App, Click Start Server, Select the SCENE API and click Start Now

Example

import requests
image_data = open("test-image5.jpg","rb").read()
response = requests.post("http://localhost:80/v1/vision/scene",files={"image":image_data}).json()
print("Label:",response["label"])
print(response)

Response

Label: conference_room
{'success': True, 'confidence': 0.7373981, 'label': 'conference_room'}