Skip to content

added ML engineer endpoints and corrected the run.sh script#2

Open
AmjedAlsadig wants to merge 1 commit intoalpha_prototypefrom
ML-Engineer-Endpoints
Open

added ML engineer endpoints and corrected the run.sh script#2
AmjedAlsadig wants to merge 1 commit intoalpha_prototypefrom
ML-Engineer-Endpoints

Conversation

@AmjedAlsadig
Copy link
Copy Markdown
Collaborator

ML Engineer Endpoints & Swagger Documentation

Description

This PR implements the core API requirements for the ML Engineer role, allowing them to query annotation projects, labels, and download images It also adds detailed Swagger documentation for these new endpoints.

Key Changes

1. New ML Engineer Endpoints:

  • GET /api/ML-Engineer/projects: Returns a full manifest of all projects, including their assigned label types and image lists.
  • GET /api/ML-Engineer/label-types: Returns the dataset ontology (all available label schemas).
  • POST /api/ML-Engineer/images/labels: Bulk retrieval of ground-truth labels.
  • GET /api/ml/images/:id/download: Binary Download Proxy.
    • Streams the raw image file (PNG/JPG) from MinIO directly to the client, satisfying the requirement to "return in the format of the image."

2. Storage Layer Updates:

  • Added getEnrichedAnnotationsByImageIds: Performs SQL joins between annotations, labelClasses, and labels tables.
  • Added getAllProjectsWithManifest: Aggregates project metadata with image counts and label definitions.

3. Documentation:

  • Added standard Swagger comments to routes.ts so these endpoints appear correctly in the Swagger UI with testable example bodies (e.g., for the bulk ID list).

How to Test

  1. Run npm run dev.
  2. Go to http://localhost:5006/api-docs.
  3. Authorize as a user with the ml_engineer role. when you login you receive a token which you should send for all the requests; to do so copy the token and paste it in lock icon button which will show a for to input the authorization token.
  4. Test the endpoints

Related Requirements

  • Querying of all images stored in the system... returned in format of the image.
  • Querying of labels stored in the system for particular image or images... returned in format of the image.
  • Querying of labels stored in the system... returned in JSON format.
  • Querying of all annotation projects... including images and label type.

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.

1 participant