Skip to content

Commit

Permalink
Open API Documentation for Object Detection Endpoints (#846)
Browse files Browse the repository at this point in the history
* added object-detection.yaml and endpoints folder

* renamed endpoints folder to train and added object-detection.yaml to openapi.yaml

* added train tag

* added parameters data to openapi.yaml

* fixed location of required: true

* changed tags to train

* changed summary to object detection

* added documentation for transforms

* changed problem type to detection type

* added notification phone number and email to review

---------

Co-authored-by: Austin Tsang <[email protected]>
  • Loading branch information
karkir0003 and Dashrekker authored Jul 7, 2023
1 parent c6c0b19 commit 55dab2d
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ tags:
description: Test API endpoints
- name: trainspace
description: Everything about trainspace
- name: train
description: Everything about train endpoints
servers:
- url: http://localhost:8000
paths:
Expand All @@ -41,6 +43,8 @@ paths:
$ref: paths/trainspace/create-trainspace.yaml
/api/trainspace/getTrainspaceData:
$ref: paths/trainspace/getTrainspaceData.yaml
/api/train/object-detection:
$ref: paths/train/object-detection.yaml
/api/trainspace/getUserProgressData:
$ref: paths/trainspace/getUserProgressData.yaml
/api/trainspace/updateOneUserProgressData:
Expand Down
102 changes: 102 additions & 0 deletions openapi/paths/train/object-detection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
post:
summary: Object Detection
description: API Endpoint to create an object-detection trainspace.
tags:
- train
requestBody:
content:
application/json:
schema:
type: object
required:
- uid
- dataset_data
- name
- parameters_data
- review_data
properties:
uid:
type: string
description: User ID
dataset_data:
type: object
description: Image to run detection on
name:
type: string
description: Name of the trainspace
review_data:
type: object
description: Phone number and email of the user
properties:
notification_phone_number:
type: string
description: Phone number of the user
notification_email:
type: string
description: Email of the user
parameters_data:
type: object
description: Parameters for the detection
properties:
detection_type:
type: string
description: Type of detection
detection_problem_type:
type: string
description: Type of detection problem
transforms:
type: array
description: Transforms to apply to the image
items:
type: object
description: Transform to apply to the image
properties:
value:
type: string
description: Type of transform to apply
parameters:
type: array
description: Parameters for the transform

example:
uid: "1234"
dataset_data: { "name": "image.jpg" }
name: "trainspace"
review_data:
{
"notification_phone_number": "1234567890",
"notification_email": "[email protected]",
}
parameters_data:
{
"problem_type": "rekognition",
"detection_problem_type": "labels",
"transforms": [{ "value": "Resize", "parameters": [100, 100] }],
}
required: true
responses:
"200":
description: Trainspace created successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "success"
trainspace_id:
type: string
example: "1234"
"400":
description: Trainspace Creation didn't go through successfully. This is usually something wrong with your code
"401":
description: User is not authenticated
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "User is not authenticated"

0 comments on commit 55dab2d

Please sign in to comment.