Git Product home page Git Product logo

jibjib-query's Introduction

This service utilizes TensorFlow Serving to load a protobuffer-serialized TensorFlow model and make it accessible through a custom, Flask-based REST API.

TensorFlow Serving is an open-source software library for serving machine learning models. It deals with the inference aspect of machine learning, taking models after training and managing their lifetimes, providing clients with versioned access via a high-performance, reference-counted lookup table.

Repo layout

The complete list of JibJib repos is:

  • jibjib: Our Android app. Records sounds and looks fantastic.
  • deploy: Instructions to deploy the JibJib stack.
  • jibjib-model: Code for training the machine learning model for bird classification
  • jibjib-api: Main API to receive database requests & audio files.
  • jibjib-data: A MongoDB instance holding information about detectable birds.
  • jibjib-query: A thin Python Flask API that handles communication with the TensorFlow Serving instance.
  • gopeana: A API client for Europeana, written in Go.
  • voice-grabber: A collection of scripts to construct the dataset required for model training

Installation

Remotely

Use the jibjib-api deployment instructions to deploy the whole microservices stack to AWS.

Locally

Clone the repo:

git clone https://github.com/gojibjib/jibjib-query
cd jibjib-query

Get the model:

curl https://s3-eu-west-1.amazonaws.com/jibjib/model/jibjib_model_serving.tgz | tar -xvz -C app/input/model/

Get the mappings:

curl https://s3-eu-west-1.amazonaws.com/jibjib/pickle/mapping_pickles.tgz | tar -xvz -C app/input/pickle

Make sure to have Docker and Docker Compose installed, then start the stack:

docker-compose up -d

Test it:

curl -H 'Content-Type: application/octet-stream' -X POST --data-binary @bird_voice.mp4 http://localhost:8081/detect/binary

jibjib-query's People

Contributors

obitech avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jibjib-query's Issues

no moov atom Error

Error while transforming the MP4 file.

The system returns to me that the MP4 file has no moov atom Table, but it has.

I tried to add it manually using following command:
ffmpeg -i flutter_sound_example_1.mp4 -vcodec copy -acodec copy -movflags faststart output_video_file.mp4
to no avail.

I shortened the audio file.
To no avail.

jibjib-api      | 2021/09/09 18:29:08 POST buffer (size: 12243) to http://jibjib-query:8081/detect/binary as application/octet-stream
jibjib-query    | Traceback (most recent call last):
jibjib-query    |   File "/app/code/util/system.py", line 90, in mp4_to_wav
jibjib-query    |     song = AudioSegment.from_file(input_path, "mp4")
jibjib-query    |   File "/usr/local/lib/python2.7/site-packages/pydub/audio_segment.py", line 690, in from_file
jibjib-query    |     raise CouldntDecodeError("Decoding failed. ffmpeg returned error code: {0}\n\nOutput from ffmpeg/avlib:\n\n{1}".format(p.returncode, p_err))
jibjib-query    | CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1
jibjib-query    |
jibjib-query    | Output from ffmpeg/avlib:
jibjib-query    |
jibjib-query    | ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
jibjib-query    |   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
jibjib-query    |   configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
jibjib-query    |   libavutil      55. 34.101 / 55. 34.101
jibjib-query    |   libavcodec     57. 64.101 / 57. 64.101
jibjib-query    |   libavformat    57. 56.101 / 57. 56.101
jibjib-query    |   libavdevice    57.  1.100 / 57.  1.100
jibjib-query    |   libavfilter     6. 65.100 /  6. 65.100
jibjib-query    |   libavresample   3.  1.  0 /  3.  1.  0
jibjib-query    |   libswscale      4.  2.100 /  4.  2.100
jibjib-query    |   libswresample   2.  3.100 /  2.  3.100
jibjib-query    |   libpostproc    54.  1.100 / 54.  1.100
jibjib-query    | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x564cd092efc0] moov atom not found
jibjib-query    | /app/uploads/238ddacf-20d9-419c-bd69-35305072ca07: Invalid data found when processing input
jibjib-query    |
jibjib-api      | 2021/09/09 18:29:08 84.115.228.34:24032       POST    /detect/binary  185.655391ms

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.