Skip to content

Commit

Permalink
Add a draft identification test
Browse files Browse the repository at this point in the history
  • Loading branch information
eleurent committed Sep 9, 2024
1 parent c411977 commit 040e2f8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions backend/nature_go/identification/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

from django.test import TestCase
from identification import gemini
from observation.models import Species


class GeminiTestCase(TestCase):
def setUp(self):
Species.objects.create(
type=Species.BIRD_TYPE,
scientificNameWithoutAuthor='Alcedo atthis',
commonNames=['Common kingfisher'],
genus='Alcedo',
family='Alcedinidae',
)

def test_gemini_identification(self):
image_path = './identification/test_bird_image.jpg' # TODO: download from link
location = {}

response = gemini.gemini_identify_few_shot(
image_path=image_path,
location=location,
few_shots=gemini.BIRD_ID_FEW_SHOTS,
)
print(response)
self.assertIsNotNone(response)

0 comments on commit 040e2f8

Please sign in to comment.