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

Feature/vector tiles training files #291

Merged
merged 23 commits into from
Oct 17, 2024

Conversation

kshitijrajsharma
Copy link
Member

@kshitijrajsharma kshitijrajsharma commented Oct 14, 2024

Blocked by #289

What does this PR do ?

  • Adds base model to models table , Default is RAMP but choices are Yolo and Ramp

New Model table :

image

  • Adds vector tile generation logic for the aois and labels in each training checkpoint

image

This is how pmtiles will look like with AOI and labels + Queryable attribute

  • Adds banner table with its CURD API

Table :
image

CURD:

image

  • Implements basic authentication of is user staff ? is user admin ? is this object belongs to user ? and is user logged in

  • Adds training centroid option when training is finished

  • Refactors all user related information from 'created_by' or 'approved_by' to user --- To maintain consistency

  • Adds searching by id feature to models endpoint

eg : https://fair-dev.hotosm.org/api/v1/model/?search=12

  • Adds feedback count to training object get endpoint directly

eg : https://fair-dev.hotosm.org/api/v1/training/20/

  • Improves admin view to change permission of users for admin -: Adds search , sort and update permission
  • Adds the kpi stats endpoint

eg: https://fair-dev.hotosm.org/api/v1/kpi/stats/

Consideration

This should be the stable version , centroid which is being stored after each training is done so that it can be fetched when training is published and linked to model . This PR includes heavy refactor , please be cautious !

Deletion is not allowed for anyone until and unless it is not your object , only staffs/ admin are allowed to delete
POST request is allowed if user is not associated to particular request : for eg - you can still create new training

Django authentication is extended and followed the same standard.
Banner message is a textfield which can store raw .md

How to test ?

TODO :

  • Publish .pmtiles to s3 and add cache in s3 bucket requests to render pmtiles faster

@kshitijrajsharma kshitijrajsharma marked this pull request as ready for review October 15, 2024 14:00
@omranlm
Copy link
Contributor

omranlm commented Oct 15, 2024

@kshitijrajsharma does the permission on https://fair-dev.hotosm.org/api/v1/workspace/download/dataset_286%2Foutput%2Ftraining_638%2Fmeta.pmtiles/

Means that I can't also download other files in the v1/workspace/download/ end point?
for example, download the model h5?

@kshitijrajsharma
Copy link
Member Author

@kshitijrajsharma does the permission on https://fair-dev.hotosm.org/api/v1/workspace/download/dataset_286%2Foutput%2Ftraining_638%2Fmeta.pmtiles/

Means that I can't also download other files in the v1/workspace/download/ end point?

for example, download the model h5?

yes , you should be able to download once you are logged in ! Pass your osm token you should be in , There is no permission to view the file but login is needed to download ! This is to avoid random script pointing to our production server

Copy link
Contributor

@omranlm omranlm left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for your efforts
@jeafreezy over to you upon deployment on the dev env

backend/core/views.py Show resolved Hide resolved
@jeafreezy
Copy link
Collaborator

jeafreezy commented Oct 15, 2024

Looks great, thanks for your efforts @jeafreezy over to you upon deployment on the dev env

Thanks for your great work @kshitijrajsharma .

I have a question: Is the name and route constant i.e I should retrieve the pmtiles from the ...api/v1/workspace/download/dataset_286/output/training_638/meta.pmtiles. endpoint.

@jeafreezy
Copy link
Collaborator

  • Adds searching by id feature to models endpoint

eg : https://fair-dev.hotosm.org/api/v1/model/?search=12

This works, however, it's returning multiple results. Id should be unique right?

@jeafreezy
Copy link
Collaborator

Adds the kpi stats endpoint
eg: https://fair-dev.hotosm.org/api/v1/kpi/stats/

Please cache this endpoint if you haven't already given that it's going to the landing page.

We might need to add some skeleton/defaults there to avoid long page loads since it's the landing page @omranlm.

@kshitijrajsharma
Copy link
Member Author

kshitijrajsharma commented Oct 15, 2024

This works, however, it's returning multiple results. Id should be unique right?

Its a search , it will return all the id that matches the search parameter
@jeafreezy

for unique use this one :
https://fair-dev.hotosm.org/api/v1/model/?id=12

@kshitijrajsharma
Copy link
Member Author

kshitijrajsharma commented Oct 15, 2024

I have a question: Is the name and route constant i.e I should retrieve the pmtiles from the ...api/v1/workspace/download/dataset_286/output/training_638/meta.pmtiles. endpoint.

Not yet , I will give you the s3 link perhaps , We are thinking about it ! @jeafreezy

@jeafreezy
Copy link
Collaborator

This works, however, it's returning multiple results. Id should be unique right?

Its a search , it will return all the id that matches the search parameter @jeafreezy

for unique use this one : https://fair-dev.hotosm.org/api/v1/model/?id=12

This is what I need. Thanks!

@kshitijrajsharma
Copy link
Member Author

@jeafreezy Cache is enabled on the endpoint for kpi stats . Global cache is applied for 15 min ! it should be more than okay ! Thanks

@kshitijrajsharma kshitijrajsharma merged commit 55d160c into develop Oct 17, 2024
5 checks passed
@kshitijrajsharma kshitijrajsharma deleted the feature/vector-tiles-training-files branch October 17, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants