Skip to content

Commit

Permalink
Merge branch 'test/views' of https://github.com/nifedara/fAIr into te…
Browse files Browse the repository at this point in the history
…st/views
  • Loading branch information
nifedara committed Jul 31, 2024
2 parents fa4aa61 + 597417d commit fb97009
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 122 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/backend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ jobs:
- name: Create env
run: |
cd backend/
mv sample_env .env
export DATABASE_URL=postgis://admin:password@localhost:5432/ai
export RAMP_HOME="/home/runner/work/fAIr/fAIr"
export TRAINING_WORKSPACE="/home/runner/work/fAIr/fAIr/backend/training"
export DATABASE_URL=$DATABASE_URL
export RAMP_HOME=$RAMP_HOME
export TRAINING_WORKSPACE=$TRAINING_WORKSPACE
- name: Run celery worker
run: |
Expand All @@ -120,6 +120,9 @@ jobs:
- name: Run migrations
env:
TESTING_TOKEN: ${{ secrets.TESTING_TOKEN }}
OSM_CLIENT_ID: ${{ secrets.OSM_CLIENT_ID}}
OSM_CLIENT_SECRET: ${{ secrets.OSM_CLIENT_SECRET}}
OSM_SECRET_KEY: ${{ secrets.OSM_SECRET_KEY}}
run: |
cd backend/
python manage.py makemigrations
Expand Down
50 changes: 24 additions & 26 deletions .github/workflows/frontend_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,41 @@ name: Frontend Build

on:
push:
branches: [ master ]
branches: [master]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build.yml'
- "frontend/**"
- ".github/workflows/frontend_build.yml"
pull_request:
branches: [ master ]
branches: [master]
paths:
- 'frontend/**'
- '.github/workflows/frontend_build.yml'
- "frontend/**"
- ".github/workflows/frontend_build.yml"

jobs:
Build_On_Ubuntu:

runs-on: ubuntu-latest
env:
CI: false

strategy:
matrix:
node-version: [ 16.14.2, 16, 18, 20 ]
node-version: [16, 18, 20]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
cd frontend/
npm install --legacy-peer-deps
- name: Build
run: |
cd frontend/
npm run build
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: |
cd frontend/
npm install --legacy-peer-deps
- name: Build
run: |
cd frontend/
npm run build
5 changes: 5 additions & 0 deletions backend/tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def test_create_training(self):
"model": self.model.id,
}
res = self.client.post(
f"{API_BASE}/training/",
json.dumps(training_payload),
f"{API_BASE}/training/",
json.dumps(training_payload),
headers=json_type_header,
Expand All @@ -148,6 +150,8 @@ def test_create_training(self):
"model": self.model.id,
}
res = self.client.post(
f"{API_BASE}/training/",
json.dumps(training_payload),
f"{API_BASE}/training/",
json.dumps(training_payload),
headers=json_type_header,
Expand All @@ -168,6 +172,7 @@ def test_create_training(self):
json.dumps(training_payload),
headers=json_type_header,
)
print(res.json())
self.assertEqual(res.status_code, status.HTTP_201_CREATED)

# create another training for the same model
Expand Down
8 changes: 5 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "fair",
"version": "0.1.0",
"private": true,
"engines": {
"node": "16.14.2"
},
"dependencies": {
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
Expand All @@ -18,6 +15,8 @@
"@mui/material": "^5.6.1",
"@mui/styles": "^5.12.0",
"@mui/x-data-grid": "^5.17.12",
"@mui/x-tree-view": "^7.11.0",
"@terraformer/wkt": "^2.2.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
Expand Down Expand Up @@ -62,5 +61,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"ajv": "^7.2.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import TreeView from "@mui/lab/TreeView";
import { SimpleTreeView } from "@mui/x-tree-view";
import TreeItem from "@mui/lab/TreeItem";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import ExpandLessIcon from "@mui/icons-material/ExpandLess";
Expand Down Expand Up @@ -73,7 +73,7 @@ const FilesTree = (props) => {
<LinearProgress color="hot" />
</Stack>
)}
<TreeView
<SimpleTreeView
aria-label="file system navigator"
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ExpandLessIcon />}
Expand Down Expand Up @@ -126,7 +126,7 @@ const FilesTree = (props) => {
{/* <TreeItem key={key} nodeId="1" label="Applications">
<TreeItem nodeId="2" label="Calendar" />
</TreeItem> */}
</TreeView>
</SimpleTreeView>
</>
);
};
Expand Down
20 changes: 5 additions & 15 deletions frontend/src/components/Layout/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,13 @@ const GetStarted = () => {
variant="body1"
style={{ color: "#3D3D3D", fontSize: "18px", marginBottom: "50px" }}
>
fAIr is an open AI-assisted mapping service developed by the
Humanitarian OpenStreetMap Team (HOT) that aims to improve the
efficiency and accuracy of mapping efforts for humanitarian purposes.
The service uses AI models, specifically computer vision techniques, to
detect objects such as buildings, roads, waterways, and trees from
satellite and UAV imagery. The name fAIr is derived from the following
terms:
fAIr performs mapping in the same way as human mappers using HOT's Tasking Manager. It looks at UAV imagery and produces map data that can be added to OpenStreetMap (OSM). Tests show a 100% speedup compared to manual mapping. It uses Artificial Intelligence (AI) to accomplish this.
<br />
<br />
<ul style={{ listStyleType: "none", paddingLeft: 0 }}>
<li>f: for freedom and free and open-source software</li>
<li>AI: for Artificial Intelligence</li>
<li>
r: for resilience and our responsibility for our communities and the
role we play within humanitarian mapping
</li>
</ul>
fAIr is developed by the Humanitarian OpenStreetMap Team (HOT) and all the software is free and open source.
<br />
<br />
Before fAIr is used, it needs to be fine-tuned by training on high quality map data for a small representative part of the geographical region where it is to be used.
</Typography>
<div
style={{
Expand Down
Loading

0 comments on commit fb97009

Please sign in to comment.