Perception is a headless web application for encoding caption data to CEA-608 byte pairs and logging the data as JSON to a file. The specification for implementing the encoder can be found on this wiki page: https://en.wikipedia.org/wiki/EIA-608
There are two outputs of Perception. The first is located at Perception/data/byte_pairs. This file is the caption data that has been input converted into byte pairs. The seconde is the captions in the basic JSON schema format. This is located at Perception/data/schema. This file can be used to load the caption data into the web application.
- Clone the repository:
git clone https://github.com/capstone-team-a/Perception.git
- Navigate to the Perception backend directory:
cd Perception/src/server
- Install Python dependencies with pip:
pip3 install -r requirements.txt
- Invoke main.py with a valid JSON file:
python3 main.py path-to-file.json
Perception expects a JSON file with the following format:
{
"file_name": "test file",
"caption_format": "CEA-608",
"scene_list": [
{
"scene_id": 1,
"scene_name": "Scene 1",
"caption_list": [
{
"caption_id": 1,
"caption_name": "Caption 1",
"caption_string": "I'm your huckleberry",
"background_color": {
"color": "black"
},
"foreground_color": {
"color": "white"
},
"text_alignment": {
"placement": "left"
},
"underline": true,
"italics": false,
"opacity": 100
}
],
"start": {
"time": 0
},
"position": {
"row": "11"
}
}
]
}
- Clone the repository:
git clone https://github.com/capstone-team-a/Perception.git
- Navigate to the Perception frontend directory:
cd Perception/src/client
- Run the npm command to install necessary dependencies:
npm install
- Run the npm command to bundle all JavaScript files into one file: bin/app.js
npm start
- Navigate to the Perception backend directory:
cd Perception/src/server
- Install Python dependencies with pip:
pip3 install -r requirements.txt
- Start the Flask application:
flask run
- Open your browser to:
http://localhost:5000
Note:
If you have receiving errors regarding Python failing to find modules. Try to export the path to Perception into the PYTHONPATH environment variable:
export PYTHONPATH="${PYTHONPATH}:path/to/Perception/"
The user can change the path to the folder for the byte pair generator output by changing the "path_to_data_folder" variable in the "config.py" file located in the "server" folder.
- Navigate to the client directoy:
cd Perception/src/client
- Run the test suite:
npm test
This will automatically run any tests defined in any .js file within the src/tests
directory.
The convention will be to name each test file with the same name as the file it is testing.
- Navigate to the server directory:
cd Perception/src/server
- Run the test suite:
python3 -m unittest
- Python 3.7.4
- Flask 1.1.1
- Mithril 2.0.4
- Thong Nguyen
- Joseph Jindrich
- Kennedy Hahn
- Ebraheem AlAthari
- Evan Hackett
- Gennadii Sytov
- Samuel Little
- Marko Bozic
This project is licensed under the MIT License - see the LICENSE.md file for details
- Hat tip to anyone whose code was used
- Inspiration