Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleted about.Vue #90

Merged
merged 6 commits into from Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Bug report
description: Report a problem you encountered
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to complete this bug report!
- type: checkboxes
id: terms
attributes:
label: Guidelines
description: By submitting this issue, you agree to follow our [Contributing Guidelines](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
options:
- label: I agree to follow this project's Contributing Guidelines.
required: true
- type: input
id: project
attributes:
label: Project Version
description: Which project versions are affected?
placeholder: "1.0, 2.2, 3.5.1"
validations:
required: false
- type: input
id: platform
attributes:
label: Platform and OS Version
description: Which platforms or operating systems are affected?
placeholder: "macOS 10.15.1, Ubuntu 20.04"
validations:
required: false
- type: input
id: existing-issues
attributes:
label: Existing Issues
description: Are there any similar existing issues?
placeholder: "#42"
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Clearly and concisely describe the bug.
placeholder: Tell us what happened.
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: Steps to reproduce
value: |
1.
2.
3.
...
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: What should have happened?
placeholder: What did you expect to happen?
validations:
required: true
- type: textarea
id: attachments
attributes:
label: Attachments
description: Please include code snippets, stack traces, or compiler errors.
placeholder: Paste code snippets, stack traces, and compiler errors here
validations:
required: false
- type: textarea
id: screenshots
attributes:
label: Screenshots or Videos
description: Add screenshots, gifs, or videos to help explain your problem.
placeholder: Upload screenshots, gifs, and videos here
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional Information
description: Add any other useful information about the problem here.
placeholder: Is there any additional helpful information you can share?
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Feature request
description: Suggest an idea for this project
title: "[Feature]: "
labels: ["feature request", "enhancement", "feature"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to complete this form!
- type: checkboxes
id: terms
attributes:
label: Guidelines
description: By submitting this issue, you agree to follow our [Contributing Guidelines](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
options:
- label: I agree to follow this project's Contributing Guidelines.
required: true
- type: textarea
id: description
attributes:
label: Description
description: Clearly and concisely describe what you would like to change, add, or implement.
placeholder: Tell us your idea.
validations:
required: true
- type: textarea
id: problem
attributes:
label: Problem
description: Is your feature request related to a problem?
placeholder: What problem will this solve?
validations:
required: true
- type: textarea
id: solution
attributes:
label: Proposed Solution
description: How should this be solved?
placeholder: How do you think this should be implemented?
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Are there other possible approaches?
placeholder: Can you think of any other options?
validations:
required: true
23 changes: 23 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper.md
- name: Upload
uses: actions/upload-artifact@v1
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper.pdf
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@ data
# other
.DS_Store

#Google drive
*.ini

# R Studio
*.Rproj

**/*.pyc
.python-version
**/*.zip
pyrightconfig.json
archive/
tmp/
.Rproj.user
delete.bat
.Rhistory
model/build/Mask*
model/build/taco*
model/build/taco*
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
## AI for Litter Detection (Web Application)
# Trash AI: Web application for serverless image classification of trash
[![Website](https://img.shields.io/badge/Web-TrashAI.org-blue)](https://www.trashai.org)


### Project Information

- Sponsor: Win Cowger, UC Riverside - Trash Data Projects
- Meeting Times: Wednesdays at 6:30pm (Weekly Brigade Meetings)
- Sponsor: Win Cowger, [Moore Institute for Plastic Pollution Research](https://mooreplasticresearch.org/)
- Meeting Times: Wednesdays at 6:30pm PT [Weekly Brigade Meetings](https://www.meetup.com/code4sac/)

### Project Summary

- Description: Develop web application where users can upload photos of street litter which will be labeled using computer vision to detect and categorize litter type.
- Benefit: Enhance abilities of researchers to quickly label photos and categorize types.
Trash AI is a web application where users can upload photos of litter, which will be labeled using computer vision to detect and categorize litter in the image by type. Early inspiration from [WADE AI](https://github.com/letsdoitworld/wade-ai) streamlined this development. Trash AI will enhance the abilities of researchers to quickly label trash in photos.

#### Demo
[![image](https://user-images.githubusercontent.com/26821843/188515526-33e1196b-6830-4187-8fe4-e68b2bd4019e.png)](https://youtu.be/HHrjUpQynUM)

## Deployment

You can simply go to www.trashai.org to start using the tool or deploy it yourself. Current self-deployment options are local deployment with docker to remote on Amazon Web Services (AWS).

### [Local Development](./docs/localdev.md)

Run the environment live with localstack, and docker
- Run the environment live with localstack and docker.

### [AWS Deployment](./docs/git-aws-account-setup.md)

### [AWS Deployments](./docs/git-aws-account-setup.md)
- Instructions on bringing up a new AWS deployment.

Instructions on bringing up a new deployment
#### [Continuous Integration and Continuous Delivery (CI/CD) - Github Actions](./docs/github-actions.md)

### [CI/CD - Github Actions](./docs/github-actions.md)
- Mostly CD at this point.

Mostly CD at this point.
#### [Github Actions AWS Deployment Role](./docs/github-actions-deployment-role.md)

### [Github Actions AWS Deployment Role](./docs/github-actions-deployment-role.md)
- Runs the complex stuff so you don't have to.

Runs the complex stuff so you don't have to
## Contribute
We welcome contributions of all kinds. To get started, open an [issue](https://github.com/code4sac/trash-ai/issues) or [pull request](https://github.com/code4sac/trash-ai/pulls). Here are some ideas on [How to Contribute](https://opensource.guide/how-to-contribute/). Please adhere to this project's [Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4 changes: 3 additions & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import logging
import os
from random import randint
from pathlib import Path
from typing import Dict, Union

Expand Down Expand Up @@ -170,7 +171,8 @@ async def upload(

@app.get("/test")
async def test():
return {"message": "Hello World"}
rint = randint(0, 100000000)
return {"message": f"Hello World: {rint}"}



Expand Down
59 changes: 33 additions & 26 deletions docs/localdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

When doing local development, you can run this stack in the background and
edit files in the `/backend` and `/frontend` directories and the environment
with automatically update.
with automatic update.

The listening port for the web frontend defaults to `http://localhost:5150`,
The backend is exposed via `http://localhost:4000` by default.
Expand All @@ -13,54 +13,61 @@ These values can be adjusted by editing the localdev env file [.env](../localdev

## _*IMPORTANT*_

It's suggested you work in branch `local` when developing
It's suggested you work in branch `local` by creating your own local branch when developing
Pushing / merging PR's to any branches with a prefix of `aws/` will trigger deployment actions
For full functionality you will want to get a Google Maps API key and name it VITE_GOOGLE_MAPS_API_KEY, but it is not required
=======


---
# Set up

## Operating System Requirements

- Linux
- MacOS (testing)
- Windows using WSL2
- Windows using [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install)
- WSL Integration on Ubuntu must be enabled in Docker options -> Resources -> WSL Integration
- Repo must be inside Ubuntu (i.e. ~/code/trash-ai)
- Make local must be run from a WSL (Ubuntu) terminal
- Take note of docker-compose installation (installing through apt may not install the correct version)

## Software Requirements

- docker ce
- ubuntu/debian: https://docs.docker.com/engine/install/ubuntu/
## 1. Install Required Software
- docker desktop (or configure docker engine and docker-compose another way)
- ubuntu/debian: https://docs.docker.com/desktop/install/linux-install/
- mac: https://docs.docker.com/desktop/mac/install/
- docker-compose [Instructions](https://docs.docker.com/compose/install/)
- Docker-compose file version `>3.7` are supported
- For MacOS, use docker-compose version 1.x
```shell
$ docker-compose disable-v2
```

---

## Optional Software

- windows: https://docs.docker.com/desktop/install/windows-install/
- If prompted to do so, download and install the Linux kernel update package. Complete steps 4-6 in the linked article.

### Optional Software
- gnu make
- ubuntu/debian: `apt-get install build-essential`
- ubuntu/debian/wsl2: `apt-get install build-essential`
- mac: `brew install make`

## Running the dev environment
## 2. Install repo
- Windows: Repo must be inside Ubuntu (i.e. ~/code/trash-ai)

### Using make in project root:

```
make local
```shell
cd ~/
mkdir code
cd code
git clone https://github.com/code4sac/trash-ai
```

---

### Using the shell:
## Running the local dev environment

### Option 1. Using make in project root:
- Windows: Make local must be run from a WSL (Ubuntu) terminal
```shell
cd trash-ai
make local
```

---

### Option 2. Using the shell:
```shell
cd localdev
# need to make sure the containers are down before starting
docker-compose down
Expand Down
25 changes: 11 additions & 14 deletions frontend/src/views/test.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<template>
<b> The cake is a lie. </b>
<SelectLabel />
<div class="rectangle">
<v-card height="100vh">
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam
erat, sed diam voluptua. At vero eos et accusam et justo duo dolores
et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est
Lorem ipsum dolor sit amet.
</v-card>
</div>
<b> The cake is a lie. {{ vardata }} </b>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
Expand All @@ -23,6 +13,11 @@ export default defineComponent({
appstore,
}
},
data() {
return {
vardata: 'not initialized',
}
},
computed: {
env() {
return import.meta.env
Expand All @@ -31,9 +26,11 @@ export default defineComponent({
async mounted() {
log.info('test mounted')
this.appstore.setTitle('Test')
/* const val = await m.Axios.getInstance().test() */
/* m.log.debug('Test Response', val.data) */
/* m.log.debug('mounted', import.meta.env) */
const val = await m.Axios.getInstance().test()
this.vardata = val.data.message
m.log.debug('Test Response', val.data)
m.log.debug('mounted', import.meta.env)

},
})
</script>
Loading