Skip to content

Commit 11d3a31

Browse files
authored
Merge pull request #26 from datarootsio/bugfix
Bugfix
2 parents 1942ed2 + 36a7b7f commit 11d3a31

11 files changed

+92
-126
lines changed

README.md

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ Follow the steps below, to run the entire pipeline.
110110
```
111111
git clone https://github.com/datarootsio/face-mask-detection.git
112112
cd face-mask-detection
113-
tar xvfz data.tar.gz
113+
mkdir data
114+
tar -xvf data.tar.gz -C ./data
114115
pip install -r requirements.txt
115116
```
116117
After completing these steps, you can run and play with the model in `scripts/predict.ipynb` notebook.
@@ -124,32 +125,9 @@ If you want to recreate the `data` folder and retrain `masked or not masked` cla
124125
5. Run `predict.ipynb` to run entire pipeline and see an example output of face mask detection model.
125126

126127
## Getting Started for Calling Deployed Face Mask Detection Model
127-
The model has been deployed in the [dploy.ai](dploy.ai) platform. By making a REST call, you can provide your image and get the prediction response.
128-
129-
The input should have the following format:
130-
131-
```
132-
{
133-
image: <Base64 Image String>,
134-
type: <Image Type e.g. jpg, jpeg, png>
135-
}
136-
```
137-
The response will have the following format:
138-
```
139-
{
140-
'detected_face_coordinates': <the bounding box coordinates of the detected faces e.g.
141-
[[x1, y1, x2, y2], [x1, y1, x2, y2]]>,
142-
'detected_mask_scores': <the prediction score of the detected faces between 0 and 1 e.g.
143-
["0.8", "0.99", "0.001"]>,
144-
'detected_face_labels': <human readible classification results of the detected faces e.g.
145-
[masked, masked, not masked]>,
146-
'annotated_image': <annotated base64 image that visualizes the prediction results with
147-
bounding boxes and text labels>,
148-
'image_type': <Image Type e.g. jpg, jpeg, png>
149-
}
150-
```
151-
128+
The model is ready to be deployed using [dploy.ai](dploy.ai) platform. `dploy.ai` is a brand new deployment platform where you can dploy your ML models super easily. Please follow [`this guide`](https://docs.dploy.ai/docs) to deploy an example model.
152129

130+
You can also easily deploy this repo locally using the open sourced [`dploy-kickstart`](https://docs.dploy.ai/docs/python#4-testing-dploy-locally).
153131

154132
## Contact
155133
Ping us:

data.tar.gz

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:536f2fab0a94bfaef794a4b2b75faa490df5f313b628f1e9401270283af99c08
3-
size 103918001
2+
oid sha256:f8056eabf9d7c7b36917053ca57e21985c5ee1b4afe8d5fe89dc6f7c7355555a
3+
size 106224675

dploy.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11
model_id: d36795f9-0376-4a4a-bc05-0fb964ee229b
2-
description: |
3-
Face masks are crucial in minimizing the propagation of COVID-19, and are highly recommended or even obligatory in many situations.
4-
5-
This deployed model gives access to dataroots' [open-sourced](https://github.com/datarootsio/face-mask-detection) face mask detection project.
6-
7-
You can interactively test the model below. Or you can use the model via through our API with the following steps:
8-
9-
1. Subscribe to this model
10-
2. Copy your user-id and api-key tokens
11-
3. Perform the following request
12-
13-
```sh
14-
curl --request POST \
15-
--url https://${modelversion_id}.users.dploy.ai/ \
16-
--header 'content-type: application/json' \
17-
--header 'x-api-key: <insert your api key>' \
18-
--header 'x-api-user: <insert your api id>' \
19-
--data '{"image": "<insert your base64string>", "type": "png"}'
20-
```
21-
For an example of how to use this within your application, check out our [examples](https://github.com/dploy-ai/dploy-examples)
22-
spec_version: "0.1"
2+
spec_version: v2
233
spec:
244
environment:
255
base: python:3.7
266
entrypoint: scripts/predict.ipynb
277
requirements: ["requirements.txt"]
288
replicas: 1
29-
max_replicas: 5

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
tensorflow==2.1.2
1+
tensorflow==2.3
22
numpy==1.18.2
33
opencv-python==4.2.0.34
44
PyYAML==5.3.1
@@ -14,4 +14,4 @@ googledrivedownloader==0.4
1414
face-detection==0.1.4
1515
tqdm==4.44.1
1616
pandas==1.0.3
17-
face_detection==0.1.4
17+
face-recognition==1.3.0
-165 Bytes
Loading

scripts/img/confusion.png

-1.08 KB
Loading

scripts/img/ex_img_annotated.jpg

24 Bytes
Loading

scripts/img/roc_classification.png

3 Bytes
Loading

scripts/predict.ipynb

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

scripts/prep-data.ipynb

Lines changed: 64 additions & 55 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)