Skip to content

Commit

Permalink
fix: fixed the name json key naming in image-prediction-collection API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagrutiti committed Sep 14, 2022
1 parent bd84e2a commit 3a32fec
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 45 deletions.
88 changes: 44 additions & 44 deletions doc/references/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,45 @@ The page, count, value_tag to the predictions must be supplied.
}
```

### Image Collection[/images/]

Get all images [GET]

The list is ordered with the most recent first.

The count, page must be supplied

- Parameters
- page (int) - the page number to return (default: 1)
- count (int) - number of results to return (default: 25)
- barcode (str, optional) - the barcode of the product.
- with_predictions (bool, optional) -
if false (the default) returns only images where no prediction was made
if true, returns all images corresponding to criterias

- server_domain (str, optional) - server domain. Default to 'api.openfoodfacts.org'

- Response 200 (application/json)

```
{
'count': 1,
'images': [{
'id': 14,
'barcode': '123',
'uploaded_at': '2022-09-13T16:11:39.272087',
'image_id': 'image-01',
'source_image': '/images/01.jpg',
'width': 400,
'height': 400,
'deleted': False,
'server_domain': 'api.openfoodfacts.localhost',
'server_type': 'off'
}],
'status': 'found'
}
```

### Image Prediction Collection [/images/prediction/collection/]

Get all image predictions [GET].
Expand All @@ -241,8 +280,8 @@ The page, count must be supplied
```
{
'count': 1,
'images': [{
'id': 10,
'image_predictions': [{
'id': 20,
'type': 'category',
'model_name': 'universal-logo-detector',
'model_version': 'tf-universal-logo-detector-1.0',
Expand All @@ -253,11 +292,11 @@ The page, count must be supplied
'bounding_box': [0.4, 0.4, 0.6, 0.6]
}]
},
'timestamp': '2022-09-13T15:40:46.071377',
'timestamp': '2022-09-14T14:57:33.952455',
'image': {
'id': 11,
'id': 22,
'barcode': '123',
'uploaded_at': '2022-09-13T15:40:46.072360',
'uploaded_at': '2022-09-14T14:57:33.953365',
'image_id': 'image-01',
'source_image': '/images/01.jpg',
'width': 400,
Expand All @@ -272,45 +311,6 @@ The page, count must be supplied
}
```

### Image Collection[/images/]

Get all images [GET]

The list is ordered with the most recent first.

The count, page must be supplied

- Parameters
- page (int) - the page number to return (default: 1)
- count (int) - number of results to return (default: 25)
- barcode (str, optional) - the barcode of the product.
- with_predictions (bool, optional) -
if false (the default) returns only images where no prediction was made
if true, returns all images corresponding to criterias

- server_domain (str, optional) - server domain. Default to 'api.openfoodfacts.org'

- Response 200 (application/json)

```
{
'count': 1,
'images': [{
'id': 14,
'barcode': '123',
'uploaded_at': '2022-09-13T16:11:39.272087',
'image_id': 'image-01',
'source_image': '/images/01.jpg',
'width': 400,
'height': 400,
'deleted': False,
'server_domain': 'api.openfoodfacts.localhost',
'server_type': 'off'
}],
'status': 'found'
}
```

### Logo Annotation Collection[/annotation/collection/]

Get all Logo annotations [GET]
Expand Down
2 changes: 1 addition & 1 deletion robotoff/app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ def on_get(self, req: falcon.Request, resp: falcon.Response):
response["image_predictions"] = []
response["status"] = "no_image_predictions"
else:
response["images"] = images
response["image_predictions"] = images
response["status"] = "found"

resp.media = response
Expand Down

0 comments on commit 3a32fec

Please sign in to comment.