Skip to content

Commit

Permalink
setup update, pip upgrade, merged testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BryonLewis committed Apr 19, 2024
1 parent 02fe582 commit 6adb205
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 75 deletions.
2 changes: 1 addition & 1 deletion bats_ai/core/migrations/0010_compressedspectrogram.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.1.13 on 2024-04-12 18:56
# Generated by Django 4.1.13 on 2024-04-19 13:55

import django.contrib.postgres.fields
from django.db import migrations, models
Expand Down
17 changes: 0 additions & 17 deletions bats_ai/core/migrations/0011_spectrogram_colormap.py

This file was deleted.

1 change: 0 additions & 1 deletion bats_ai/core/models/compressed_spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def predict(self):

img = Image.open(self.image_file)


relative = ('..',) * 4
asset_path = os.path.abspath(os.path.join(__file__, *relative, 'assets'))

Expand Down
7 changes: 1 addition & 6 deletions bats_ai/core/models/spectrogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import io
import logging
import math
import os

from PIL import Image
import cv2
Expand All @@ -15,12 +14,9 @@
import librosa
import matplotlib.pyplot as plt
import numpy as np

from .recording import Recording
import scipy
import tqdm

from bats_ai.core.models import Annotations, Recording
from .recording import Recording

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -237,7 +233,6 @@ def generate(cls, recording, colormap=None, dpi=520):
colormap=colormap,
)
spectrogram.save()
os.remove(f'/tmp/temp.{colormap}.jpg')
return spectrogram.pk

@property
Expand Down
4 changes: 1 addition & 3 deletions bats_ai/core/rest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from rest_framework import routers

from .image import ImageViewSet
from .spectrogram import SpectrogramViewSet

__all__ = ['ImageViewSet', 'SpectrogramViewSet']
__all__ = ['SpectrogramViewSet']

rest = routers.SimpleRouter()
rest.register(r'images', ImageViewSet)
rest.register(r'spectrograms', SpectrogramViewSet)
42 changes: 0 additions & 42 deletions bats_ai/core/rest/image.py

This file was deleted.

2 changes: 2 additions & 0 deletions dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ COPY ./setup.py /opt/django-project/setup.py

# Use a directory name which will never be an import name, as isort considers this as first-party.
WORKDIR /opt/django-project
# hadolint ignore=DL3013
RUN pip install --no-cache-dir --upgrade pip

RUN set -ex \
&& pip install --no-cache-dir -e .[dev]
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
'django-allauth',
'django-configurations[database,email]',
'django-extensions',
'django-filter',
'django-large-image',
'django-oauth-toolkit',
'djangorestframework',
Expand All @@ -55,20 +54,21 @@
'django-s3-file-field[boto3]<1',
'gunicorn',
'flower',
'large-image[rasterio,pil]>=1.22',
# Spectrogram Generation
'librosa',
'matplotlib',
'mercantile',
'numpy',
# 'onnxruntime-gpu',
'onnx',
'onnxruntime',
# 'onnxruntime-gpu',
'opencv-python-headless',
'tqdm',
'django-large-image',
# large image
'django-large-image>=0.10.0',
'large-image[rasterio,pil]>=1.22',
'rio-cogeo',
'mercantile',
# guano metadata
'guano',
],
extras_require={
Expand Down

0 comments on commit 6adb205

Please sign in to comment.