├── C# └── C#QuickStart.cs ├── Java └── JavaQuickStart.java ├── Python └── PythonQuickStart.py └── README.md /C#/C#QuickStart.cs: -------------------------------------------------------------------------------- 1 | var client = new HttpClient(); 2 | var request = new HttpRequestMessage 3 | { 4 | Method = HttpMethod.Post, 5 | RequestUri = new Uri("https://face-mask-detection.p.rapidapi.com/FaceMaskDetection"), 6 | Headers = 7 | { 8 | { "x-rapidapi-key", "APIKEY" }, 9 | { "x-rapidapi-host", "face-mask-detection.p.rapidapi.com" }, 10 | }, 11 | Content = new FormUrlEncodedContent(new Dictionary 12 | { 13 | { "linkFile", "" }, 14 | }), 15 | }; 16 | using (var response = await client.SendAsync(request)) 17 | { 18 | response.EnsureSuccessStatusCode(); 19 | var body = await response.Content.ReadAsStringAsync(); 20 | Console.WriteLine(body); 21 | } 22 | -------------------------------------------------------------------------------- /Java/JavaQuickStart.java: -------------------------------------------------------------------------------- 1 | HttpRequest request = HttpRequest.newBuilder() 2 | .uri(URI.create("https://face-mask-detection.p.rapidapi.com/FaceMaskDetection")) 3 | .header("content-type", "application/x-www-form-urlencoded") 4 | .header("x-rapidapi-key", "APIKEY") 5 | .header("x-rapidapi-host", "face-mask-detection.p.rapidapi.com") 6 | .method("POST", HttpRequest.BodyPublishers.ofString("linkFile=%3CREQUIRED%3E")) 7 | .build(); 8 | HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); 9 | System.out.println(response.body()); 10 | -------------------------------------------------------------------------------- /Python/PythonQuickStart.py: -------------------------------------------------------------------------------- 1 | import requests (From Rapidapi.com) 2 | 3 | url = "https://face-mask-detection.p.rapidapi.com/FaceMaskDetection" 4 | 5 | payload = "imageBase64=%3CREQUIRED%3E" 6 | headers = { 7 | 'content-type': "application/x-www-form-urlencoded", 8 | 'x-rapidapi-key': "Rapidapi key", 9 | 'x-rapidapi-host': "face-mask-detection.p.rapidapi.com" 10 | } 11 | 12 | response = requests.request("POST", url, data=payload, headers=headers) 13 | 14 | print(response.text) 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Face Mask Detection 2 | PresentID Face mask detection API can detect whether a person is wearing a mask. 3 | This service can recognize all the faces in the image and say whether people have masks or not! 4 | 5 | ![mask-myths 1](https://user-images.githubusercontent.com/63470748/119659107-18050300-be43-11eb-8fec-e4af2e6f1831.jpg) 6 | 7 | 8 | **Input:** 9 | - Image file 10 | - Image URL link 11 | - Base64 image 12 | 13 | **Output:** 14 | - Masked: 0 or 1 15 | 16 | **Ability & Potentials:** 17 | - Recall rate on FDDB:70.6, Classification Accuracy: 93.7. 18 | - Less than 300 milliseconds processing time. 19 | - Detect all small and large faces. 20 | - High-precision detection of size; pitch, roll, yaw, and 14-point key landmarks. 21 | - Low resource and impressive high performance. 22 | - Robust detection of faces with rotation, glasses, etc. 23 | - Region of interest detection. 24 | - Support IOS, Android, Windows, and Mac devices. 25 | - Easy integration with your app. 26 | 27 | **Use Cases:** 28 | - Building access control 29 | 30 | **Rules & Restrictions:** 31 | - Send data via base64 or an image URL or an image file. 32 | - Image size should not exceed 8 MB. 33 | - Also, the images should not be larger than 5000 pixels and smaller than 50 pixels. 34 | ## Free try in RapidAPI 35 | https://rapidapi.com/PresentID/api/face-mask-detection 36 | --------------------------------------------------------------------------------