Skip to content

Commit

Permalink
Add readme for API requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed May 30, 2024
1 parent 757e9cb commit 8e898bb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 44 deletions.
24 changes: 7 additions & 17 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,27 @@ This project was bootstrapped with [Geodjango Template](https://github.com/itsk
source ./env/bin/activate

##### Setup Basemodels (Ramp Supported Currently)
- Install git lfs
```bash
sudo apt-get install git-lfs
```

- Clone Ramp Basemodel
```
git clone https://github.com/radiantearth/model_ramp_baseline.git
```
OR Download from google drive
```
pip install gdown
gdown --fuzzy https://drive.google.com/file/d/1wvJhkiOrSlHmmvJ0avkAdu9sslFf5_I0/view?usp=sharing
```

- Clone Ramp - Code
Note: This clone location will be your RAMP_HOME
```
git clone https://github.com/kshitijrajsharma/ramp-code-fAIr.git ramp-code
```

- Copy Basemodel checkpoint to ramp-code
```
cp -r model_ramp_baseline/data/input/checkpoint.tf ramp-code/ramp/checkpoint.tf
```

Our Basemodel is available for public download [here](https://drive.google.com/file/d/1wvJhkiOrSlHmmvJ0avkAdu9sslFf5_I0/view?usp=sharing)

You can unzip and move the downloaded basemodel
```
unzip checkpoint.tf.zip -d ramp-code/ramp
```


- Remove basemodel repo we don't need it anymore
```
Expand Down Expand Up @@ -136,11 +130,7 @@ pip install -r requirements.txt
You will need more env variables (Such as Ramp home, Training Home) that can be found on ```.sample_env```

#### Now change your username, password and db name in settings.py accordingly to your database
python manage.py makemigrations login
python manage.py migrate login
python manage.py makemigrations core
python manage.py migrate core
python manage.py makemigrations
python manage.py makemigrations login core
python manage.py migrate
python manage.py runserver
### Now server will be available in your 8000 port on web, you can check out your localhost:8000/admin for admin panel
Expand Down
23 changes: 23 additions & 0 deletions backend/api-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
django==4.1.4
# gdal==3.6.2
# psycopg2==2.9.9
djangorestframework==3.14.0
djangorestframework-gis==1.0
dj-database-url==1.2.0
django-leaflet==0.28.3
drf-yasg==1.21.4
django-environ==0.9.0 # used for environment
django-filter==22.1
django-cors-headers==3.13.0 # used for enabling cors when frontend is hosted on different server / origin
osm-login-python==0.0.2
celery==5.2.7
redis==4.4.0
django_celery_results==2.4.0
flower==1.2.0
validators==0.20.0
gpxpy==1.5.0
geojson2osm==0.0.1
osmconflator==0.0.9
orthogonalizer==0.0.4
fairpredictor==0.0.26
tflite-runtime==2.14.0
28 changes: 1 addition & 27 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
django==4.1.4

gdal==3.6.2
psycopg2


djangorestframework==3.14.0
djangorestframework-gis==1.0
dj-database-url==1.2.0
django-leaflet==0.28.3
drf-yasg==1.21.4
# Pillow
django-environ==0.9.0 # used for environment
django-filter==22.1
django-cors-headers==3.13.0 # used for enabling cors when frontend is hosted on different server / origin
osm-login-python==0.0.2
celery==5.2.7
redis==4.4.0
django_celery_results==2.4.0
flower==1.2.0
validators==0.20.0
gpxpy==1.5.0
-r api-requirements.txt
hot-fair-utilities==1.2.3
geojson2osm==0.0.1
osmconflator==0.0.9
orthogonalizer==0.0.4
fairpredictor==0.0.26
tflite-runtime==2.14.0
1 change: 1 addition & 0 deletions backend/sample_env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DEBUG=True
SECRET_KEY=yl2w)c0boi_ma-1v5)935^2#&m*r!1s9z9^*9e5co^08_ixzo6
DATABASE_URL=postgis://admin:password@localhost:5432/ai
EXPORT_TOOL_API_URL=MY_RAW_DATA_URL
Expand Down

0 comments on commit 8e898bb

Please sign in to comment.