Liveness detection using ViT model
ViT model:
- cpu: < 10 FPS
- gpu: 60 FPS
Resnet50 model:
- cpu: < 30 fps
- gpu: < 70 FPS
Here I have 2 servers in localhost:8091 and localhost:8092. Then I will use NGINX as an API gatway or load balancer
First, I have config to run the server using wsgi server called waitress pip install waitress
Then setup NGINX docker container run -p 8090:80 --name nginx_tutorial nginx docker container exec -it nginx_tutorial bash apt-get update apt-get install nano nano nginx.conf
The set up is as this link: https://viblo.asia/p/cau-hinh-nginx-server-nhu-the-nao-ByEZko0xZQ0
Then we modify the nginx.conf file
events {
}
http {
upstream backend_servers {
server your_host:8091;
server your_host:8092;
}
server {
listen 80;
server_name nginx-tutorial.test;
location / {
proxy_pass http://backend_servers;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
We have to add 1 more line in the file etc/hosts
like this
127.0.0.1 nginx-tutorial.test
Reference: https://viblo.asia/p/load-balancing-voi-nginx-bWrZnVxnZxw
Then run:
python src/api.py
python src/api_2.py
python src/test_api.py
We can see that the port is changing over time -> success
liveness_vit's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.