The essence of a GraphQL request is super-simple. You send a post request with a query in the body and the GraphQL server responds with the the results of your query as JSON. There are a few things that can trip you up, but once you are aware of them, you can easily make GraphQL calls without using any special frameworks.
FathomNet expects that your images are hosted on a public web server.
There are a number of tools that are popular in the marine science community for annotating images and/or video. Keep in mind that FathomNet uses rectangular localizations, also called bounding boxes, that define a region of interest for an annotation. If you are defining other types of regions of interest (ROI), such as points, free-form polygons, or pixel masks, those will need to be converted to rectangular ROI’s when submitting your data to FathomNet.
Below is an example CSV file showing the minimum required columns. …
Pascal VOC is an XML format used for defining rectangular regions of interest in images. Created for the Visual Object Challenge (VOC), it’s commonly used in machine learning communities as an interchange format for detection labels on images. Here’s an example VOC file:
It’s quick and easy to parse this using Scala. Recent versions of Scala do not ship with an XML parsing library, so be sure to include it in your project with these sbt coordinates:
"org.scala-lang.modules" %% "scala-xml" % "1.3.0"
Note that it’s possible to put other fields into a VOC file but, in general, the most…
Circe is a Scala library for decoding (reading) and encoding (writing) JSON. I’m a big fan of it’s simplicity, flexibility, and conciseness. This guide walks through a simple use case that illustrates Circe’s basic usage, creating a custom encoder and decoder, and common gotchas.
Below, I’ve created a simple JSON schema. The schema is composed of catalogs, which are named grouping of files, and blobs, which are composed of a URL pointer to a file and its checksum. Every object will have a UUID to uniquely identify it.
An example JSON object is below:
Security is imperative when writing web apps; but security and authentication are hard to do right. When developing client/server applications, I want to take advantage of solutions that are written by teams that really know how to do security well. For a recent project, I used the combination of Firebase for user authentication and JWT for securing the server-side APIs.
In this article, the server is a REST API written in Micronaut. All authentication and security is done using bearer tokens. The security flow is simple:
Scripting is the art of creating a small, simple program to execute some task. Probably the most common examples are the bash scripts used to launch a program on macOS or Linux. If you find yourself typing the same set of commands over and over to accomplish a task, you may decide to wrap those in a simple script to save the tedious typing and mental real-estate needed to hold the sequence and syntax of the commands in your head. …
Jupyter notebooks are becoming a popular tool in data scientist’s toolboxes. As a free, open-source, interactive web notebook, researchers can combine software, explanatory text, and computational results in a single easy-to-follow document. Their interactive nature allows for users to execute code, quickly see the resulting output, and iteratively modify the notebook. This creates a living document allowing researchers to have an exploratory “conversation” with their data.
Once upon a time, I needed to call a microservice that could return a lot of data. So much data, that the request would often timeout. The usual solution to this is to request smaller chunks of data, also called pages. A page request takes two parameters, often called limit and offset. Limit is the number of items to be returned. Offset is the number of items to be skipped before beginning to return items
I recently purchased the book Classic Computer Science Problems in Python to help me brush up on my python. As I’m working through the Python code in the book, I’m taking some time to also port the Python to Scala. Below is an example the illustrates trivial compression for efficiently storing genes. A little science refresher, genes are typically made of Five nucleobases — adenine (A), cytosine ©, guanine (G), thymine (T), and uracil (U). Uracil (U) and thymine (T) are very similar except uracil is found in RNA, thymine (T) replaces uracil in DNA.
Below I’ll show the example…