Skip to content

Commit

Permalink
updated readmes and changed gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamintdk committed Jan 16, 2022
1 parent 51b0a28 commit f63852a
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 34 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
ignore: "E402"
max-line-length: "120"
path: .
- uses: actions/checkout@v2
Expand Down Expand Up @@ -83,9 +84,10 @@ jobs:
npm install
npm run build
npm run deploy
- uses: actions/checkout@v2
- name: Bump version and push tag
uses: anothrNick/[email protected]
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
if: ${{ !contains(join(github.event.commits.*.message, ' '), '#skip') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
Expand Down
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#common
.vscode/
__pycache__/
venv/
.env

#train_and_predict
labeled*/
unlabeled*/
*.h5

#preprocess
ts/
temp/
unlabeled*/

#webapp
node_modules/
dist/
.DS_Store

#api
app.db
test.db
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The tool has been divided into different modules:
- **Preprocessing of unlabeled data:** it contains a Python script that generates mp3 files and spectrograms, given a directory containing audio data.
- **A Machine Learning Endpoint:** which is a small flask app that -- given an h5 file, a labeled dataset and an unlabeled dataset -- trains an ML model on the labeled data and predicts on the unlabeled data.

Go into each directory to learn how to get started with it.
Go into each directory to learn how to get started with it. You will want to visit the directories in this order: preprocess --> train_and_predict --> api --> webapp.

**Flowchart of how the tool works:**
![flowchart](api/assets/flowchart.jpg)
Expand Down
6 changes: 0 additions & 6 deletions api/.gitignore

This file was deleted.

5 changes: 3 additions & 2 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ headers: {

# Getting Started

This API requires a database and a ML endpoint to run, the easiest way to do that would be run the ML endpoint's docker container by following the [train_and_predict quick method](../train_and_predict/README.md#quick-method), and to start a docker postgres database with the following command: `docker run --name postgres -p 5432:5432 -e POSTGRES_DB=orcagsoc -e POSTGRES_PASSWORD=<database-password> -d postgres`.
This API requires a database and a ML endpoint to run, the easiest way to do that would be run the ML endpoint's docker container by following the [train_and_predict quick method](../train_and_predict/README.md#quick-method), and to start a docker postgres database with the following command: `docker run --name postgres -p 5432:5432 -e POSTGRES_DB=orcagsoc -e POSTGRES_PASSWORD=<database-password> -d postgres`. After these steps, choose either the quick method or flexible method to proceed.

### Quick Method

Expand All @@ -236,7 +236,7 @@ This API requires a database and a ML endpoint to run, the easiest way to do tha
ML_ENDPOINT_URL=http://127.0.0.1:5001
S3_LABELED_PATH=s3://orcagsoc/labeled_test/
S3_UNLABELED_PATH=s3://orcagsoc/unlabeled_test/
S3_MODEL_PATH=s3://orcagsoc/models/srkw_cnn_0.h5
S3_MODEL_PATH=s3://orcagsoc/models/srkw_0.h5
RETRAIN_TARGET=20
IMG_WIDTH=607
IMG_HEIGHT=617
Expand All @@ -246,6 +246,7 @@ This API requires a database and a ML endpoint to run, the easiest way to do tha
- Run `flask db upgrade` to update the tables of the database
- `flask run` starts a development server in http://localhost:5000
- If you plan to contribute, please configure your text editor / IDE to use Flake8 to lint and YAPF to format Python code
- N.B. If pipenv does not work for you, a requirements.txt file has been provided which you can use with pip to install packages instead
### Testing
Expand Down
10 changes: 5 additions & 5 deletions api/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Handle circular imports
from .active_learning import train_and_predict
# from app import routes, models
from app.models import LabeledFile, Model, Prediction, ConfusionMatrix, Accuracy

from flask import Flask
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy
Expand Down Expand Up @@ -35,6 +30,11 @@
db = SQLAlchemy(app)
migrate = Migrate(app, db)

# Handle circular imports
from .active_learning import train_and_predict
# from app import routes, models
from app.models import LabeledFile, Model, Prediction, ConfusionMatrix, Accuracy

if not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == "true":
# The app is not in debug mode or we are in the reloaded process
# Start training if the tables generated after each training round are empty
Expand Down
6 changes: 0 additions & 6 deletions preprocess/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions train_and_predict/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions webapp/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Getting Started

- Make sure [Node.js](http://nodejs.org) is installed
- Make sure [Node.js v14.x](http://nodejs.org) is installed
- Clone the repo and `cd` into the project directory
- Run `npm install` to install all the dependencies
- Run `npm start` to start a development server in [http://localhost:8080](http://localhost:8080) (For the app to work correctly, you need to start the API server as well)
Expand Down

0 comments on commit f63852a

Please sign in to comment.