ausocean / openfish

OpenFish is an open-source system written in GoLang for classifying marine species. Tasks involve importing video or image data, classifying and annotating data (both manually and automatically), searching, and more. It is expected that OpenFish will use utilize computer vision and machine learning techniques.
https://ausocean.github.io/openfish/
Other
6 stars 0 forks source link

Expand the list of species #127

Closed scott97 closed 3 months ago

scott97 commented 6 months ago

Maintaining a list of species in our database would involve a lot of work. Potentially we could use inaturalist's API to fetch a list of species and their images. To get the most popular species we can make a query like so:

GET https://api.inaturalist.org/v1/taxa?is_active=true&taxon_id=<taxon_id>&rank=species&order=desc&order_by=observations_count

In this query the taxon ID is used to filter to only show its descendants. Combined with rank=species it can find all the species within that category. We will need to make multiple queries and merge the results to get a satisfactory list of marine life. This is because marine animals do not fit neatly into one category.

Vertibrates

Within the vertibrates, I think we should include all within:

Within Birds Class Aves

Within Mammals Class Mammalia

Within Reptiles Class Reptilia

Within Amphibians more research needed

Invertibrates

more research needed

Species API and caching

Since there are many species, and a bit of work merging the results of multiple requests, it would be best to cache the info we need in our datastore, omitting the data that we don't need.

Sources:

scott97 commented 6 months ago

I propose we add a new API to import species from inaturalist. This API would be for Admins only and could be used periodically to keep our species list up to date.

POST /api/v1/species/import-inaturalist?descendants_of=Infraorder Cetacea,Order Sphenisciformes,Class Holocephali etc

This API will use the provided name and rank(s) to query the inaturalist API for species and insert these species into the datastore.

Updating already imported species

In our datastore, we will store the inaturalist taxon id if a species is imported. When that species is imported again, we can search by this id and can update that species instead of creating a new one.

Preview API

POST /api/v1/species/import-inaturalist?descendants_of=Infraorder Cetacea&preview=true

This API would provide information about what will be inserted and updated but not perform the action.

scott97 commented 6 months ago

https://www.inaturalist.org/pages/api+recommended+practices

Key points: