Skip to content

Web-based API version of the popular DeepView tool

Notifications You must be signed in to change notification settings

OlegGolfer7/DeepView.Profile-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepView.Profile API

DeepView

DeepView.Profile API is a RESTful service wrapper around DeepView.Profile which is profiling tool of PyTorch neural networks.

Installation

DeepView.Profile API has same requirements as DeepView.Profile.

It works NVIDIA GPU environments with CUDA. CUDA support by PyTorch and drivers must start fom 11.7+ version.

if you have installed NVIDIA drivers you may check CUDA version using following command:

nvidia-smi

Installation from source

git clone https://github.com/cpavel/DeepView.Profile-API.git
cd deepview_profile_api
pip install -r requirements.txt

Install project into Docker Container

You may create docker image to run project in container. First clone project from repo, then run following command from the root folder of the repo

docker build --pull --rm . -f "docker/Dockerfile" -t deepview/service:latest

Running Service

Set up env variables

Set DEBUG to True if necessary, either in .env file or in system environment variable

export DEBUG=True

Run development server

Run Django development server from repo root:

python manage.py runserver 0.0.0.0:80

You may change port if necessary.

If Debug=False, you may need to add runserver --insecure param to see Swagger UI

Running service in container

Make sure have installed NVIDIA Container Toolkit first. If you have troubles with setting up your host machine, you may read How to Install PyTorch on the GPU with Docker.

Run container

docker run -it --rm --gpus all -v $(pwd):/app/ -p 80:80 deepview/service

Production server consideration

  • Production server must not use Django development web server
  • You will need to route Django static files to be able see Swagger UI
  • Don't forget to check final settings by
python manage.py check --deploy

Service usage

Dev tooling

Black v2023+ is used for code formatting Ruff v0.0.292+ is used for code linting

About

Web-based API version of the popular DeepView tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.5%
  • Dockerfile 3.5%