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

feat(api): Create new API routers and data types #11

Merged
merged 41 commits into from
Dec 1, 2023
Merged

Conversation

cpvannier
Copy link
Member

@cpvannier cpvannier commented Nov 30, 2023

Description

Refactor API with new endpoints, new methods, new data types, and new unit tests

Fixes #5

Changes

Added

  • Add new classes related to DatasetInfo for updated API (DatasetCategory, DatasetStat, DatasetTable)
  • Add new class related to Dataset for updated API (DatasetItem)
  • Add new classes related to DatasetItem for updated API (ItemEmbedding, ItemFeature, ItemObject, ItemView)
  • Add from_rle method to BBox
  • Add file_name, width, and height properties to Image
  • Add option to load a list of DatasetCategory (category id and name pairs) in Importers
  • Export the complete list of DatasetCategory (category id and name pairs) in Exporters
  • Add new unit tests and refactor existing unit tests

Changed

  • Refactor API with new endpoints, new methods, new data types, and new unit tests
  • Update Dataset and DatasetInfo classes for new API
  • Update Exporters, Importers, and InferenceModels using updated API

Fixed

  • Fix type hints in CompressedRLE and RLE related utils functions
  • Fix pip install commands in notebooks for Google Colab
  • Fix ignoring null bounding boxes

Previously done in format_bbox function in backend
format_bbox was deleted in #7 to keep same format between front and back
Add Pydantic BaseModel to Dataset
Move find function from DatasetInfo to Dataset
Allows creating a BBox from a CompressedRLE
Checks if PyArrow type is binary, which is used for embeddings
New features:
- Dataset:
  - Add load_items, search_items, load_item, save_item methods for API
- DatasetItem, ItemEmbedding, ItemFeature, ItemObject, ItemView:
  - Add from_pyarrow methods for loading item
  - Add to_pyarrow methods for saving item objects and features

Refactoring:
- Move Dataset, DatasetInfo, DatasetStat, DatasetItem to data.dataset
- Move ItemEmbedding, ItemFeature, ItemObject, ItemView to data.item
- Move test files accordingly
Use new methods in API routers instead of mock data
Refactor COCOExporter using new Dataset and DatasetItem methods
Add COCOxporter unit test
Replace lists of Features, Views, Objects, Embeddings by dicts
Allows for easier data manipulation in both backend and frontend
Also make more fields mandatory in DatasetInfo
In Importer, move input_dirs field to __init__
This allows for loading all the DatasetCategories using input_dirs

In Exporter, export the list of DatasetCategory from DatasetInfo to file
@cpvannier cpvannier self-assigned this Nov 30, 2023
@cpvannier cpvannier linked an issue Nov 30, 2023 that may be closed by this pull request
@jrabary jrabary merged commit 0064103 into develop Dec 1, 2023
15 checks passed
@cpvannier cpvannier added scope: api Related to Pixano API enhancement New feature or request labels Dec 6, 2023
@cpvannier cpvannier added this to the Pixano 0.5.0 milestone Jan 16, 2024
@cpvannier cpvannier deleted the feat/api_routers branch January 31, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scope: api Related to Pixano API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REST API improvement
3 participants