Please use
https://github.com/ieeelpirc
Low-Power Image Recognition Challenge
If you have any questions or suggestions, please send email to [email protected]. Thank you.
To help you test, a web site is available, please do the following
python client.py -w 128.46.75.108 --user lpirc --pass pass
@2015 - HELPS, Purdue University
- Session logout functionality.
- Powermeter measurement stop.
- client.py - get_image(): image file write from 'w' to 'wb'
- Export database entries to csv file for post processing.
- Dump powermeter readings at an interval of 1 second to database
- Powermeter integration.
- Powermeter executable driver
- Powermeter python client
- Logout url
- Session status entry in database
- Powermeter driver source code
- If a single image has multiple bounding boxes, the client can send the bounding boxes in the same POST message.
- The client may send multiple POST messages for different bounding boxes of the same image.
- Two different images need to be sent in the different POST messages.
- The POST messages for different images may be out of order. (for example, the bounding boxes for image 5 may be sent before the bounding boxes for image 3)
- Authenticate user and provide time limited token for the session.
- Timeout is set to 5 minutes by default.
- If multiple attempts are made to login, all the previous data will be overwritten.
- Start the powermeter measurements.
- Powermeter accumulates the energy dissipated for a preset timeout.
- Send images to token validated client devices upon GET request.
- JPEG image format (*.jpg)
- Expects image index between 1 to N (Total images count) from the client.
- The client can query the available images count.
- The image list in the local directory is refreshed every time before an image is sent.
- This feature allows image directory to be modified with server running.
- Receive asynchronous post results for final evaluation.
- The results are stored in a database.
- Database allows results to be stored for all users in a single file.
- Only required user's data is written to a csv file for post processing
- Get power meter readings from powermeter.
- Powermeter readings are also stored in the same database.
- Stop the powermeter measurements upon timeout or client logout.
- Compute score based on the mAP and the energy dissipated.
- Python v2.7.3
- Flask v0.10.x - Microframework for Python
- Flask-SQLAlchemy
- Flask-Login
- itsdangerous v0.24
-
Install Python v2.7.3
-
Install any Python package manager (example pip) ref:https://pip.pypa.io/en/latest/installing.html
-
Install required packages
- Flask - pip install Flask - ref: http://flask.pocoo.org/docs/0.10/installation/
- Flask-Login - pip install Flask-Login
- Flask-SQLAlchemy - pip install Flask-SQLAlchemy - ref: https://github.com/mitsuhiko/flask-sqlalchemy
- itsdangerous - pip install itsdangerous - ref: http://pythonhosted.org//itsdangerous/
-
Check referee.py for options python referee.py --help
-
Host server (Debug mode) python referee.py --ip 127.0.0.1 --port 5000 --images "../images/.jpg" --timeout 300 - Hosts server at 127.0.0.1:5000, sending images (.jpg) to client from directory "../images". - Session timeout of 300 seconds
referee.py [OPTION]
-w, --ip
IP address of the server in format <xxx.xxx.xxx.xxx>
Default: 127.0.0.1
-p, --port
Port number of the server.
Default: 5000
--images
Test images (Relative to root directory)
Default: images/*.jpg
--result
Test results (Relative to root directory)
Default: result/result.csv
--debug
Run server in debug mode
Default: debug = None
--secret
Secret key to generate token
--timeout
Client session timeout in seconds
Default: 300 seconds (5 Minutes)
--enable_powermeter
Enables powermeter
-h, --help
Displays all the available option
(post/get) --NA-- host/
Example: curl 127.0.0.1:5000/
(post/get) --NA-- host/help
Example: curl 127.0.0.1:5000/help
(post) (username=[user]&password=[pass]) host/login
Example: curl --data "username=user&password=pass" 127.0.0.1:5000/login
(post) (token=[token]) host/verify
Example: curl --data "token=daksldjsaldkjlkj32....." 127.0.0.1:5000/verify
(post) (token=[token]) host/logout
Example: curl --data "token=daksldjsaldkjlkj32....." 127.0.0.1:5000/logout
(post) (token=[token]) host/no_of_images
Example: curl --data "token=daksldjsaldkjlkj32....." 127.0.0.1:5000/no_of_images
(post) (token=[token]&image_name=[image_index]) host/image (Image index starts with 1: 1,2,3,...)
Example: curl --data "token=daks....&image_name=3" 127.0.0.1:5000/image
(post) (token=[token]&image_name=[image_index]&..
CLASS_ID=[id]&confidence=[conf]&..
xmin=[xmin]&xmax=[xmax]&..
ymin=[ymin]&ymax=[ymax]) host/result
Example: curl --data "token=daks....&image_name=3&
CLASS_ID=7&confidence=0.38&
xmin=123.00&xmax=456.00&
ymin=132.00&ymax=756.00" 127.0.0.1:5000/result
(post) (token=[token]&player=[player_name]&..
voltage=[voltage]¤t=[current]&..
power=[power]&energy=[energy]&..
elapsed=[elapsed_time]) host/powermeter
Example: curl --data "token=daks....&player=lpirc&
voltage=120¤t=0.1&
power=9&energy=45&
elapsed=5" 127.0.0.1:5000/powermeter
(post) (token=[token]&player=[player_name]) host/savecsv (All submissions saved if no player_name)
Example: curl --data "token=daks....&player=lpirc" 127.0.0.1:5000/savecsv
- Image format: JPEG (*.jpg, *.JPEG)
- Image index starts from 1 (not 0).
- Command line arguments expect to be within quotes
- Use sql browser to view database (http://sqlitebrowser.org/)
Sample Client performs the following operations:
- POSTS username and password to start a session with the server
- POSTS the bounding box information to the server.
- Requests for the images and stores locally.
Additional Notes:
-Sample Client uses a file "golden_output.csv" which contains list of bounding box information corresponding to the test images in the server. This file is being used to simulate the recognition program the participant will have during the competition. This is just sample data to check if the interface with the server is working properly. The participant should generate this data by running the recognition software on the images sent by the server.
-client/temp is temporary directory. Images are buffered in this directory, and removed immediately after that. Images are copied to the 'images' directory if and only if, Server replies with OK status (200).
-
Install Python v2.7.3
-
Install pip Ref: http://flask.pocoo.org/docs/0.10/installation/#windows-easy-install
-
Install Virtualenv
- pip install virtualenv
- mkdir myproject
- cd myproject
- virtualenv venv
- venv\scripts\activate
-
Install required packages
- Flask
- pip install Flask
- ref: http://flask.pocoo.org/docs/0.10/installation/
- Flask-Login
- pip install Flask-Login
- Flask-SQLAlchemy
- pip install Flask-SQLAlchemy
- ref: https://github.com/mitsuhiko/flask-sqlalchemy
- itsdangerous
- pip install itsdangerous
- ref: http://pythonhosted.org//itsdangerous/
- Flask
-
Download Apache Ref: https://www.apachehaus.com/cgi-bin/download.plx
- Move Apache24 to C:/
-
Install mod_wsgi Ref: http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
- pip install (.whl file)
- Copy generated mod_wsgi.so to modules/ under Apache
-
Edit httpd.conf under C:/Apache24/conf
- Include Abs path to lpirc_win32.conf
-
Check absolute paths under lpirc_win32.conf and deploy.wsgi
-
Check lpirc server configuration (server/source/config.xml)
-
Run Apache
- C:/Apache24/bin/httpd.exe -k [start|stop|restart]
- C:/Apache24/bin/httpd.exe -S (Apache status)
- Error and access log files under C:/Apache24/logs
-
Install Python v2.7.3
-
Install pip Ref: http://flask.pocoo.org/docs/0.10/installation/#windows-easy-install
-
Install Virtualenv
- pip install virtualenv
- mkdir myproject
- cd myproject
- virtualenv venv
- . venv/bin/activate
-
Install required packages
- Flask
- pip install Flask
- ref: http://flask.pocoo.org/docs/0.10/installation/
- Flask-Login
- pip install Flask-Login
- Flask-SQLAlchemy
- pip install Flask-SQLAlchemy
- ref: https://github.com/mitsuhiko/flask-sqlalchemy
- itsdangerous
- pip install itsdangerous
- ref: http://pythonhosted.org//itsdangerous/
- Flask
-
Download Apache
-
Install mod_wsgi
-
Edit apache2.conf under /etc/apache2/
- Include (Abs path to lpirc_unix.conf)
-
Check absolute paths under lpirc_unix.conf and deploy.wsgi
-
Check lpirc server configuration (server/source/config.xml)
-
Run Apache
- apachectl -k [start|stop|restart]
- apachectl -S (Apache status)
- Error and access log files under /var/log/apache2