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

Model Creation & Edit, Banner and Start Mapping Layout #301

Merged
merged 99 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
26bd4a5
feat: implemented layouts and progress bar
jeafreezy Oct 22, 2024
3d30c54
fix: fixed typescript bug
jeafreezy Oct 22, 2024
6d49ade
fix: transferred file download to the browser
jeafreezy Oct 22, 2024
1169f5e
chore: reverting back to previous implementation
jeafreezy Oct 22, 2024
d53d320
chore: progress ...
jeafreezy Oct 30, 2024
90a169f
chore: updated model details design
jeafreezy Oct 30, 2024
5ecd04b
chore: heavy progress
jeafreezy Oct 30, 2024
323d24e
chore: linting
jeafreezy Oct 30, 2024
e294a1e
fix: fixed typescript bug
jeafreezy Oct 30, 2024
b076646
chore: validations
jeafreezy Oct 31, 2024
30a9479
chore: progres...
jeafreezy Nov 1, 2024
cd2cef9
chore: fixed typescript bug
jeafreezy Nov 1, 2024
4d28c94
completed geojson upload, zoom to aoi, delete, layer swich and more
jeafreezy Nov 1, 2024
37c3186
chore: fixed typescript bug
jeafreezy Nov 1, 2024
45fc8f8
chore: removed buildinfo
jeafreezy Nov 1, 2024
99f6220
chore: completed creation flow
jeafreezy Nov 1, 2024
efd61e4
chore: fixed typescript bug
jeafreezy Nov 1, 2024
f325aba
chore: fixed ts bug
jeafreezy Nov 1, 2024
6844a58
chore: fixed redirection upon creation
jeafreezy Nov 1, 2024
2f410cb
chore: sync with fixes branch
jeafreezy Nov 1, 2024
ab76c2a
Merge branch 'develop' into model-creation
jeafreezy Nov 1, 2024
a3f233e
chore: synced with develop
jeafreezy Nov 1, 2024
4a097b7
chore: housekeeping: removed toast provider
jeafreezy Nov 4, 2024
e5cc5d2
chore: fixed tms bbox bug
jeafreezy Nov 4, 2024
b654289
chore: updated tms regex pattern
jeafreezy Nov 4, 2024
3929229
chore: fixed redirection bug after creation, added tms tilename to su…
jeafreezy Nov 4, 2024
dc803d4
chore: training area map bug fixe
jeafreezy Nov 7, 2024
af9bec6
feat: housekeeping + model creation completed
jeafreezy Nov 9, 2024
c6a8bf5
chore: added docs
jeafreezy Nov 9, 2024
7af23cc
feat: model details editing
jeafreezy Nov 9, 2024
2b42f4d
chore: housekeeping + prepping for testing
jeafreezy Nov 10, 2024
7ba5b10
fix: fixed bug in training aoi labels download
jeafreezy Nov 10, 2024
bebebd7
chore: added timeout to form state reset
jeafreezy Nov 10, 2024
8f18411
fix: fixed propation bug in tooltip
jeafreezy Nov 10, 2024
2943862
chore: added id to training dataset and descending ordering by id
jeafreezy Nov 11, 2024
7cc6422
chore: enabled layer control for training labels, added background co…
jeafreezy Nov 11, 2024
7ba01ab
chore: fixed JSOM bug
jeafreezy Nov 11, 2024
7557754
chore: fixed zoom level order
jeafreezy Nov 11, 2024
31c9b4e
chore: fixed training accuracy image link
jeafreezy Nov 11, 2024
ef64464
chore: updated training settings with new configurations
jeafreezy Nov 11, 2024
06d6eb4
added advanced training settings for yolov8
jeafreezy Nov 11, 2024
4b74486
chore: fixed bug in error toast
jeafreezy Nov 11, 2024
0402ece
chore: added description to basemodels:
jeafreezy Nov 12, 2024
85333f2
chore: styled the training area AOI
jeafreezy Nov 12, 2024
6c1cfa2
chore: added aoi area size to file upload modal
jeafreezy Nov 12, 2024
a414fe4
chore: restyled toasts
jeafreezy Nov 14, 2024
249baac
chore: switched to session storage
jeafreezy Nov 14, 2024
5e866fb
chore: training area validations
jeafreezy Nov 14, 2024
aaea0db
chore: delayed model files retrieval
jeafreezy Nov 14, 2024
23eef78
chore: fixed typescript bugs
jeafreezy Nov 14, 2024
b42a23c
chore: added dataset name to model card + progress with model setting…
jeafreezy Nov 16, 2024
2129027
chore: made zoom 19 selected by default
jeafreezy Nov 16, 2024
0428f40
chore: updated 0 sec text to just now after fetching labels and incre…
jeafreezy Nov 16, 2024
fc46437
chore: added validation to training settings input
jeafreezy Nov 16, 2024
48f34a2
revert confirmation page after training settings validation
jeafreezy Nov 16, 2024
10cdb02
feat: progress with banner
jeafreezy Nov 16, 2024
a192d79
chore: made terradraw rectangle style to match training area aoi
jeafreezy Nov 16, 2024
8a4515e
chore: fixed training area leayout
jeafreezy Nov 16, 2024
3570a9c
feat: finalized start-mapping layout
jeafreezy Nov 16, 2024
249ceb7
chore: added base model to model grid and list viwq
jeafreezy Nov 18, 2024
32eb75c
chore: added back button
jeafreezy Nov 18, 2024
03e3177
chore: progress with model enhancement
jeafreezy Nov 18, 2024
cda0527
chore: merged with start mapping
jeafreezy Nov 18, 2024
5517809
chore: merged with start mapping
jeafreezy Nov 18, 2024
11d0ce4
feat: finalized banner
jeafreezy Nov 18, 2024
71504b5
chore: finalized model enhancement
jeafreezy Nov 19, 2024
447b86e
chore: refetch training history table after submitting new request
jeafreezy Nov 19, 2024
ab288e0
chore: disabled enhancement from anonymous users
jeafreezy Nov 19, 2024
3c66368
chore: adjusted aoi color
jeafreezy Nov 19, 2024
4df9a03
chore: added OSM last updated to training AOI tooltip
jeafreezy Nov 19, 2024
ba3dfe9
chore: added aoi labels upload
jeafreezy Nov 19, 2024
e3a6654
chore: disabled validation in training labels upload
jeafreezy Nov 19, 2024
59c33bc
chore: fixed typescript bugs
jeafreezy Nov 19, 2024
47535fb
chore: increased log height
jeafreezy Nov 19, 2024
fe8553b
chore: fixed banner bug
jeafreezy Nov 19, 2024
143defc
chore:fixed crash
jeafreezy Nov 19, 2024
e336db4
chore: added typography tto banner
jeafreezy Nov 19, 2024
87e3495
chore: made banner text white:
jeafreezy Nov 19, 2024
c3f9012
chore: made text wrap on mobile
jeafreezy Nov 19, 2024
4d95251
chore: fixed bug in user profile
jeafreezy Nov 19, 2024
eb5e322
chore: fixed bug in enhance model button
jeafreezy Nov 19, 2024
d484d66
feat: finalized logics for editing mode
jeafreezy Nov 19, 2024
e956bff
chore: minor fixes
jeafreezy Nov 19, 2024
e325ebe
chore: fixe bug
jeafreezy Nov 19, 2024
116a577
chore: progress with model edit
jeafreezy Nov 20, 2024
9eeb3b1
chore: housekeeping
jeafreezy Nov 20, 2024
f8fb7b7
chore: model edit progress
jeafreezy Nov 20, 2024
41796fb
chore: default training history table to be sorted by id
jeafreezy Nov 20, 2024
e8c8c1d
merging with model-creation branch
jeafreezy Nov 20, 2024
14ee27e
chore: housekeeping
jeafreezy Nov 20, 2024
9adb878
chore: fixed typescript bug
jeafreezy Nov 20, 2024
4f504e8
fix: ordered training history by id
jeafreezy Nov 21, 2024
c759545
feat: moved configurations to environment variables
jeafreezy Nov 21, 2024
5a79447
fix: fixed typescript bug
jeafreezy Nov 21, 2024
a986c37
chore: changed models route to ai-models
jeafreezy Nov 21, 2024
8a5c822
chore: minor fixes
jeafreezy Nov 25, 2024
b2e440b
chore: fixed bug
jeafreezy Nov 25, 2024
a603e6d
chore: added max depth to model files recursion
jeafreezy Nov 25, 2024
dc4e544
chore: fixed model background refetch
jeafreezy Nov 25, 2024
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
47 changes: 45 additions & 2 deletions frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
VITE_BASE_API_URL = 'http://localhost:8000/api/v1/' # backend api url
VITE_MATOMO_ID= 0
VITE_MATOMO_APP_DOMAIN = "subdomain.hotosm.org"
VITE_MATOMO_ID = 0
VITE_MATOMO_APP_DOMAIN = "subdomain.hotosm.org"

# The maximum allowed area size (in square meters) for training areas.
# Data type: Positive Integer e.g 500000
MAX_TRAINING_AREA_SIZE =

# The minimum allowed area size (in square meters) for training areas.
# Data type: Positive Integer e.g 500000
MIN_TRAINING_AREA_SIZE =

# The maximum file size (in bytes) allowed for training area upload.
# Data type: Positive Integer e.g 500000
MAX_TRAINING_AREA_UPLOAD_FILE_SIZE =

# The current version of the application.
# This is used in the OSM redirect callback when a training area is opened in OSM.
# Data type: String e.g 'v1.1'
FAIR_VERSION =

# Comma separated hashtags to add to the OSM ID Editor redirection
# Data type: String e.g '#HOT-fAIr, #AI-Assited-Mapping'
OSM_HASHTAGS =


# The maximum zoom level for the map.
# Data type: Positive Integer e.g 22. Must be between 0 - 24
MAX_ZOOM_LEVEL =

# The minimum zoom level to show the training area labels.
# Data type: Positive Integer e.g 18. Must be between 0 - 24
TRAINING_LABELS_MIN_ZOOM_LEVEL =

# Training area and labels styles.
# Opacities are between 0 and 1 . E.g 0.5
# Widths must be Positive Integers e.g 1, 2 etc.
# Colors must be hex codes or valid colors. E.g 'red', 'green', '#fff'
TRAINING_AREAS_AOI_FILL_COLOR =
TRAINING_AREAS_AOI_OUTLINE_COLOR =
TRAINING_AREAS_AOI_OUTLINE_WIDTH =
TRAINING_AREAS_AOI_FILL_OPACITY =
TRAINING_AREAS_AOI_LABELS_FILL_OPACITY =
TRAINING_AREAS_AOI_LABELS_OUTLINE_WIDTH =
TRAINING_AREAS_AOI_LABELS_FILL_COLOR =
TRAINING_AREAS_AOI_LABELS_OUTLINE_COLOR =
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

tsconfig.app.tsbuildinfo
tsconfig.node.tsbuildinfo
14 changes: 13 additions & 1 deletion frontend/package.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeafreezy the amount of dependencies is increasing rapidly, let's just make sure we are using community supported libs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roger that.

Thanks for your concern @omranlm . The new additions are:

  1. terraformer/wkt: We need it to convert the AOI to WKT. (Necessary)
  2. @turf/area: We need it to calculate the area for the AOI. (Necessary)
  3. @turf/bbox: We need it to get the bounds for the AOI. (Necessary)
  4. react-dropzone: We need it for the AOI file's drag-and-drop dialog functionality. (Not really necessary - we can allow the users to just open their file picker when they click on the 'upload' button. However, I must admit that it provides a better UX.)
  5. react-confetti-explosion: When the model creation is successful, we need it for the confetti explosion. (Not really necessary, too. However, I must also admit that it provides a good UX).
  6. terra-draw: For drawing functionality. (Necessary)

Some suggestions:

The top three can be delegated to the backend later in the future, therefore eliminating the dependencies.

  1. Send the raw AOI GeoJSON feature directly to the backend instead of transforming it to WKT on the client.
  2. The backend should calculate the area and return it as part of the GeoJSON feature properties.
  3. The backend should return the bbox as properties of the GeoJSON feature.

Rest assured, I will ensure all dependencies are community-supported libs and lightweight.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions:

The top three can be delegated to the backend later in the future, therefore eliminating the dependencies.

Send the raw AOI GeoJSON feature directly to the backend instead of transforming it to WKT on the client.
The backend should calculate the area and return it as part of the GeoJSON feature properties.
The backend should return the bbox as properties of the GeoJSON feature.

@jeafreezy Raise this as an issue ! I will resolve when I can

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #304 and #303 .

Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,34 @@
"@tanstack/react-query": "^5.59.0",
"@tanstack/react-query-devtools": "^5.59.0",
"@tanstack/react-table": "^8.20.5",
"@terraformer/wkt": "^2.2.1",
"@turf/area": "^7.1.0",
"@turf/bbox": "^7.1.0",
"axios": "^1.7.7",
"clsx": "^2.1.1",
"framer-motion": "^11.5.4",
"geojson": "^0.5.0",
"maplibre-gl": "^4.7.1",
"react": "^18.3.1",
"react-confetti-explosion": "^2.1.2",
"react-dom": "^18.3.1",
"react-dropzone": "^14.2.10",
"react-error-boundary": "^4.0.13",
"react-helmet-async": "^2.0.5",
"react-markdown": "^9.0.1",
"react-router-dom": "^6.26.2",
"tailwind-merge": "^2.5.2"
"remark-gfm": "^4.0.0",
"tailwind-merge": "^2.5.2",
"terra-draw": "1.0.0-beta.8"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/eslint-plugin-query": "^5.58.1",
"@types/geojson": "^7946.0.14",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/terraformer__wkt": "^2.0.3",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.9.0",
Expand Down
Loading
Loading