Already more than 100 downloads in less than 5 weeks!
This is the FastAPI backend that supports my PhotoScavenger Apps. It can detect certain objects from pictures. This API serves my iOS/Android apps for the game here: https://photoscavenger.petervandoorn.com API dashboard is here: https://photoscavenger.vdotvo9a4e2a6.eu-central-1.cs.amazonlightsail.com/
- API documentation.
- App on appstore
This backend can check images to see if a certain object is on the picture. For instance: you can check if there is a cat on a particular photo. The backend will then return a false or true for that object depending on whether it was found. It will also return a list objects it managed to find. This allows you validate in case of false negatives, to see what the model thought was on the picture. See an example below.
you make a POST request with a image in the formdata (content type 'file'). For instance this image:
and it returns an image with the detected objects:
Simply clone the repo and run:
gh repo clone two-trick-pony-NL/ScanGameBackend && cd ScanGameBackend
uvicorn main:app --host 0.0.0.0 --port 80 --reload
The V1 API has 18 objects to be detected and V2 can detect 80 different objects Their endpoinsta are:
- V1: https://photoscavenger.vdotvo9a4e2a6.eu-central-1.cs.amazonlightsail.com/uploadfile/person
- V2: https://photoscavenger.vdotvo9a4e2a6.eu-central-1.cs.amazonlightsail.com/v2/uploadfile/person
Call
http://localhost:80/v2/uploadfile/bicycle
or
http://localhost:80/uploadfile/person
Response (for bicycle)
{
"Searchedfor:": "person",
"Wasfound": "YES",
"OtherObjectsDetected": [
"person",
"person",
"person",
"person",
"chair",
"person",
"chair",
"boat",
"bird",
"person",
"person"
],
"Processed_FileName": "imagecfb104fe-8347-4ef5-b733-2a0d3d8e6b88.jpg"
}
Supported objects in V1
["background", "earoplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow", "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
Supported objects in V2
person
bicycle
car
motorcycle
airplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
couch
potted plant
bed
dining table
toilet
tv
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush
Note: Corrospond the right assignment API with the correct image detector API. As the V1 version will only know the 18 classes that AI model has. Also, the integer at the end of the call is the score the player currently has. The higher the score the more difficult the object is to find.
http://localhost:8000/newassignment/2000
http://localhost:8000/v2/newassignment/2000
response:
{"dog":"🐕"}
Here is my command to keep track of deployment
gh run watch && watch -n 5 aws lightsail get-container-log --service-name photoscavenger --container-name photoscavenger --filter-pattern deployment