Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
5072929
Remove journal
rickwg Apr 17, 2024
e0496ab
Update migration commands
rickwg Apr 17, 2024
f1e7594
Fix CORS issue
konradag May 14, 2024
9ea4321
Login/Sign up hinzugefügt
MoAlj May 25, 2024
e448c74
Merge branch 'main' of https://github.com/braindatalab/exact
MoAlj May 25, 2024
d5b0dbc
Add generic user management in backend
konradag May 25, 2024
08ad1d8
Add Mantine component library for React
konradag May 25, 2024
e98e881
Refactor login and register pages in frontend
konradag May 26, 2024
38be6c6
Fix session handling
konradag May 29, 2024
b2038b4
Implemented Challenge Management Features
mattypli May 30, 2024
de2966e
Add competition creation page
konradag Jun 1, 2024
0981a45
spelling mistake fix
mattypli Jun 3, 2024
df4b6ed
added torch hub api functionality for model loading
n-pelleriti Jun 4, 2024
cd90878
added worker documentation
n-pelleriti Jun 4, 2024
34dea44
Header bug fixed und Semi profilseite
MoAlj Jun 11, 2024
cf40795
Add mock data for testing
konradag Jun 20, 2024
2538571
Add basic grid in challenges overview page
konradag Jun 20, 2024
17c877d
changed the storage from amazon s3 to local file storage using django
mattypli Jun 20, 2024
ecc06de
Merge branch 'main' of https://github.com/braindatalab/exact
mattypli Jun 20, 2024
1f7bbe2
Fix thumbnail
konradag Jun 21, 2024
cc62028
Merge branch 'main' of https://github.com/braindatalab/exact
konradag Jun 21, 2024
a76a9e2
New backend endpoint for fetching challenges
mattypli Jun 21, 2024
9fbfa0e
chalengecard fetchen jz daten von der db
MoAlj Jun 23, 2024
d6a5267
Merge branch 'main' of https://github.com/braindatalab/exact
konradag Jun 24, 2024
022b183
Fix data retrieval in challenges overview page
konradag Jun 24, 2024
45627fe
Refactor home page
konradag Jun 24, 2024
1fc4e1b
Refactor header and footer
konradag Jun 24, 2024
9e670b4
Fix typo
konradag Jun 24, 2024
5e21c92
Add challenge details page
konradag Jun 24, 2024
aeb0f77
Add upload submission modal
konradag Jun 25, 2024
f00eb03
added multiple worker functionality
Drachling0 Jun 30, 2024
15ec7bd
score management endpoints
mattypli Jul 2, 2024
7eec72f
added media folders - docker sometimes does not create them itself
mattypli Jul 2, 2024
3be467e
added worker limit & challenge_id pass to emd
Drachling0 Jul 5, 2024
0d2cc1b
Add link inbetween challenge pages
konradag Jul 6, 2024
28a83f6
default file bug fix
mattypli Jul 7, 2024
edaf8f0
Merge branch 'main' of https://github.com/braindatalab/exact
mattypli Jul 7, 2024
0fd4f6a
Leaderboard mit mockdata
MoAlj Jul 8, 2024
005eb0c
added docker network for backend/worker containers
Drachling0 Jul 8, 2024
2381cf8
urls.py score endpoints update
mattypli Jul 8, 2024
5516579
removed backend/worker network
Drachling0 Jul 8, 2024
e6b858d
Update Dockerfile for worker
konradag Jul 8, 2024
d52ccb1
Fix view for submitting XAI methods and getting the computed score
konradag Jul 9, 2024
d05a8aa
Fix add submissions functionality in challenge detail page
konradag Jul 9, 2024
30f6240
Improve XAI method submission work flow
konradag Jul 10, 2024
4c2d550
Add 'username' field to scores
konradag Jul 13, 2024
a97ff3e
updated the README.md for backend
mattypli Jul 15, 2024
ab1711c
cleaned up model training - added ima n precision from xai-tris paper…
n-pelleriti Jul 16, 2024
916c82e
Merge branch 'main' of github.com:braindatalab/exact
n-pelleriti Jul 16, 2024
14603f7
README docker edit and cleanup
Drachling0 Jul 21, 2024
76b8a34
added TODO to emd.py and clean up
Drachling0 Jul 21, 2024
5264628
edited TODOs
Drachling0 Jul 21, 2024
8f08790
added dynamic xai method testing
n-pelleriti Jul 23, 2024
6634f1c
final score
n-pelleriti Jul 23, 2024
0805da1
Dockerfile cleanup
Drachling0 Aug 14, 2024
cebc744
added project journal
Drachling0 Aug 14, 2024
d3056fa
Merge branch 'main' of https://github.com/braindatalab/exact
Drachling0 Aug 14, 2024
9700325
updated env for django migrations
Apr 23, 2025
04ed184
accept statements in file input, size is next!
Apr 28, 2025
df1b8f1
competitions/create/page.tsx Check upload security and bugs in forms.py
May 1, 2025
ee53154
Upload von den Files sind gespeichert und können ausgelesen werden. N…
May 9, 2025
3d974a7
added documentation/db-schema.md
May 16, 2025
e321977
Cookies init
Jun 6, 2025
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
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DB_ENGINE=django.db.backends.postgresql
DB_NAME=example
DB_USER=postgres
DB_PASSWORD=example_password
DB_HOST=db
DB_PORT=5432

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
__pycache__/
worker/venv/
venv/
node_modules
settings.json
node_modules
package-lock.json
package-lock.json
todo
media
*.log
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@ This web application provides users with ML models and datasets, and evaluates t
# Requirements:

The only requirement needed for this project is docker, and enough local storage (~10 Gb).
We recommend Docker Desktop for managing the images and containers. (Link: https://www.docker.com/products/docker-desktop/)

# How to run the platform:

### building images

inside the folder containing the repository, please run the following command:
Inside the folder containing the repository, please run the following command:

`docker compose up`
`docker compose build`

The first time you run it, it might take a few minutes to finish installing all dependencies and building the images.

If you want to start all containers and the services attached to them (note: also starts a worker container):

`docker compose up`

Important: If you use Docker Desktop you need to have the app open for this to work.

### running Django migrations

When connecting to the database for the first time (e.g. after the docker volumes are created for the
Expand All @@ -25,9 +32,9 @@ After running `docker ps`, copy the name of the container with image `{root_fold
If your root folder is called "evalXai", and you used docker compose to instantiate all containers, you can use the
same container names we used in the default commands below.

`docker exec -it evalxai-backend-1 python manage.py makemigrations`
`docker exec -it exact-backend-1 python manage.py makemigrations`

`docker exec -it evalxai-backend-1 python manage.py migrate`
`docker exec -it exact-backend-1 python manage.py migrate`

Alternatively, if you have the docker desktop app, you can follow these steps:

Expand Down
4 changes: 1 addition & 3 deletions admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from django.contrib import admin
from .platform.backend.api.models import *

admin.site.register(Mlmodel)
admin.site.register(Dataset)
admin.site.register(Xaimethod)
admin.site.register(Score)
admin.site.register(Challenge)
17 changes: 13 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,35 @@
# https://github.com/docker/awesome-compose
services:
backend:
image: exact-backend
build:
context: ./platform/backend
ports:
- 8000:8000
user: root
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# - ./platform/backend/mysite/media:/app/mysite/media
- ./media:/app/mysite/media
depends_on:
- worker
- db
env_file:
- .env

frontend:
image: exact-frontend
build:
context: ./platform/frontend
ports:
- 3000:3000

worker:
build:
context: ./worker
# worker:
# image: exact-worker
# build:
# context: ./worker
# depends_on:
# - backend

# Additional configuration for the worker service

# The commented out section below is an example of how to define a PostgreSQL
Expand Down
168 changes: 129 additions & 39 deletions documentation/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@

### *XAI Detail*

- **URL** `/api/xai/<int:challenge_id>/`
- **URL** `api/xai/<str:challenge_id>/`
- **Method** POST
- **Description**
- Endpoint to for XAI script upload
- Endpoint triggers creation of a worker (runs and evaluates xai method) container
- **Parameters**
- `challenge_id`: Number
- `challenge_id`: String


### *Score Detail*

- **URL** `/api/score/<int:challenge_id>/`
- **URL** `/api/score/<str:challenge_id>/`
- **Methods** GET, POST
- **Description** Endpoint to retrieve or update scores for a challenge.
- **Parameters**
- `challenge_id`: Number
- `challenge_id`: String
- **Response**
- GET:
- `score`: Number
Expand All @@ -87,58 +87,148 @@

### *Dataset Detail*

- **URL** `/api/dataset/<int:challenge_id>/`
- **URL** `/api/dataset/<str:challenge_id>/`
- **Method** GET
- **Description** Endpoint to download dataset associated with a challenge
- **Description** Endpoint to download dataset associated with a challenge. Redirects to the url containing the file.
- **Parameters**
- `challenge_id`: Number
- `challenge_id`: String
- **Response**
- Dataset file in binary format
- Location: The URL of the dataset file associated with the challenge ID.

### *AI Detail*
### *ML Model Detail*

- **URL** `/api/mlmodel/<int:challenge_id>/`
- **URL** `/api/mlmodel/<str:challenge_id>/`
- **Method** GET
- **Description** Endpoint to download trained machine learning model associated with a challenge
- **Description** Endpoint to download trained machine learning model associated with a challenge. Redirects to the url containing the file.
- **Parameters**
- `challenge_id`: Number
- `challenge_id`: String
- **Response**
- Trained machine learning model file in binary format
- Location: The URL of the Mlmodel file associated with the challenge ID.

### *XAI Template*

- **URL** `/api/xai_template/<int:challenge_id>/`
- **URL** `/api/xaimethod/<str:challenge_id>/`
- **Method** GET
- **Description** Endpoint to download XAI template file associated with a challenge.
- **Description** Endpoint to download XAI Method file associated with a challenge. Redirects to the url containing the file.
- **Parameters**
- `challenge_id`: Number
- `challenge_id`: String
- **Response**
- XAI template file in binary format
- Location: The URL of the XAI Method template file associated with the challenge ID.

## Create Challenge

- **URL:** `/api/challenge/create/`
- **Method:** POST
- **Description:** Endpoint for creating a new challenge. It takes a title, description and 3 files - xai method template, dataset and a machine learning model. The uploaded files are saved to Amazon S3 and their URLs are stored in the Postgresql database, where the challenge_id connects all the tables.
- **Parameters:**
- `title`: String (required) - The title of the challenge.
- `description`: String (required) - Description of the challenge.
- `xai_method`: File (required) - File containing the XAI method.
- `dataset`: File (required) - File containing the dataset.
- `mlmodel`: File (required) - File containing the ML model.
- **Response:**
- Success (201): `{ "message": "Challenge created successfully" }`
- Error (400): `{ "errors": { "<field_name>": ["<error_message>"] } }`
- **Sample Request:**
```json
{
"title": "Challenge Title",
"description": "Description of the challenge",
"xai_method": <XAI_Method_File>,
"dataset": <Dataset_File>,
"mlmodel": <ML_Model_File>
}

**Notes:**
- CSRF protection is temporarily disabled for testing.

## Challenge Creation Form View

- **URL:** `/challenge/form`
- **Method:** POST
- **Description:** Endpoint for submitting a challenge form. It does the same thing as /api/challenge/create/ but provides a visual interface in the backend for sending the POST request. It takes a title, description and 3 files - xai method template, dataset and machine learning model. The uploaded files are saved to Amazon S3 and their URLs are stored in the Postgresql database, where the challenge_id connects all the tables.
- **Parameters:**
- `title`: String (required) - The title of the challenge.
- `description`: String (required) - Description of the challenge.
- `xai_method`: File (required) - File containing the XAI method.
- `dataset`: File (required) - File containing the dataset.
- `mlmodel`: File (required) - File containing the ML model.
- **Response:**
- Redirects to the success page upon successful submission.
- **Sample Request:**
```json
{
"title": "Challenge Title",
"description": "Description of the challenge",
"xai_method": <XAI_Method_File>,
"dataset": <Dataset_File>,
"mlmodel": <ML_Model_File>
}
```
- **Notes:**
- CSRF protection is temporarily disabled for testing.

## Get Challenge

- **URL:** `/challenge/<str:challenge_id>/`
- **Method:** GET
- **Description:** Endpoint for retrieving challenge details by ID of the challenge. Responds with a json with all the important information about the challenge.
- **Parameters:**
- `challenge_id`: String (required) - ID of the challenge to retrieve.
- **Response:**
- JSON object containing challenge details:
- `challenge_id`: String - ID of the challenge.
- `title`: String - Title of the challenge.
- `description`: String - Description of the challenge.
- `created_at`: String (DateTime) - Date and time when the challenge was created.
- `xai_method_url`: String (Optional) - URL of the XAI method associated with the challenge.
- `dataset_url`: String (Optional) - URL of the dataset associated with the challenge.
- `mlmodel_url`: String (Optional) - URL of the ML model associated with the challenge.
- **Sample Response:**
```json
{
"challenge_id": "123abc",
"title": "Challenge Title",
"description": "Description of the challenge",
"created_at": "2024-05-30T12:00:00Z",
"xai_method_url": "https://example.com/xai_method",
"dataset_url": "https://example.com/dataset",
"mlmodel_url": "https://example.com/mlmodel"
}
```
- **Notes:**
- If the challenge with the provided ID is not found, an error message is returned.

## *Data Model*

### *XAI Method Model*
- **Description** Model representing the XAI method associated with a challenge
- **Fields**
- `challenge_id`: IntegerField (default: 1)
- `xai_method`: JSONField (not final type, TODO)



### Score Model
- **Description** Model representing the score associated with a challenge
- **Fields**
- `challenge_id`: IntegerField (default: 1)
- **Description:** Model representing the XAI method associated with a challenge.
- **Fields:**
- `challenge_id`: CharField (max_length=100, unique=True)
- `xai_method_url`: URLField (default='')

### *Score Model*
- **Description:** Model representing the score associated with a challenge.
- **Fields:**
- `challenge_id`: CharField (max_length=100, unique=True)
- `score`: FloatField

### Dataset Model
- **Description** Model representing the dataset associated with a challenge
- **Fields**
- `challenge_id`: IntegerField (default: 1)
- `dataset`: JSONField (not final type)

### ML Model
- **Description** Model representing the machine learning model associated with a challenge
- **Fields**
- `challenge_id`: IntegerField (default: 1)
- `model`: JSONField (not final type)
### *Dataset Model*
- **Description:** Model representing the dataset associated with a challenge.
- **Fields:**
- `challenge_id`: CharField (max_length=100, unique=True)
- `dataset_url`: URLField (default='')

### *ML Model*
- **Description:** Model representing the machine learning model associated with a challenge.
- **Fields:**
- `challenge_id`: CharField (max_length=100, unique=True)
- `model_url`: URLField (default='')

### *Challenge Model*
- **Description:** Model representing a challenge.
- **Fields:**
- `challenge_id`: CharField (max_length=100, unique=True)
- `title`: CharField (max_length=100)
- `description`: TextField
- `created_at`: DateTimeField (auto_now_add=True)
Loading