blob: 388dc5daed627726799cc02e29282bc34d0887ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# VFRAME Check API
VFRAME Check API Service
## Quick Start
- Install Python 3.x (use Miniconda or your choice)
- Install nginx, MySQL
```
apt install git nginx mysql-server mysql-client
mysql_secure_installation
mysql -r root
```
Create MySQL user:
```
CREATE DATABASE vframe_check;
CREATE USER 'vframe_check'@'localhost' IDENTIFIED BY 'some_new_password';
GRANT ALL PRIVILEGES ON vframe_check.* to 'vframe_check'@'localhost';
```
Clone the repo and add a .env file:
```
DB_HOST=localhost
DB_NAME=vframe_check
DB_USER=vframe_check
DB_PASS=some_new_password
```
### Endpoints
#### POST /v1/match
Check if an image is in the database. If no images are found within the similarity threshold, add this image to the database.
Options:
- `threshold` (default: 6) - Minimum similarity threshold. This is the Hamming distance used for phash comparisons.
- `add` (default: true) - Pass `false` if you do not want the image added to the database.
#### POST /v1/similar
- `limit` (default: 10) - Number of results to return.
|