Skip to content

Instantly share code, notes, and snippets.

View 9Dave9's full-sized avatar
🍸
Bartender...Moonshots all round please!

David 9Dave9

🍸
Bartender...Moonshots all round please!
View GitHub Profile
@9Dave9
9Dave9 / gist:6e723f3c5faff5eb70b0b1395942c893
Created February 3, 2026 12:39
deep emo endpoint docuemtation
{
"openapi": "3.1.0",
"info": {
"title": "Deep-Emo API",
"description": "\n## Human Attribute and Emotion Identifier API\n\nThis API provides facial attribute analysis using the DeepFace library.\nIt can detect and analyze:\n\n- **Age**: Estimated age in years\n- **Gender**: Male/Female classification with confidence scores\n- **Race/Ethnicity**: Classification across multiple categories\n- **Emotion**: Detection of facial expressions (happy, sad, angry, etc.)\n- **Nudity Detection**: Body-part classification with covered/exposed labels\n\n### Image Input Formats\n\nThe API accepts images in the following formats:\n1. **File Upload**: Direct file upload via multipart form\n2. **Base64**: Base64-encoded image string (with or without data URL prefix)\n\n### Image Optimization\n\nImages are automatically optimized to reduce size while preserving\nessential details for accurate analysis. You can control optimization\nparameters or disable it entirely.\n\n### Token Counting\n\nEach response includes to
@9Dave9
9Dave9 / gist:efc12b499be29684f035e8771a66711f
Created February 1, 2026 22:50
deep=-emo openAPi spec json
{
"openapi": "3.1.0",
"info": {
"title": "Deep-Emo API",
"description": "\n## Human Attribute and Emotion Identifier API\n\nThis API provides facial attribute analysis using the DeepFace library.\nIt can detect and analyze:\n\n- **Age**: Estimated age in years\n- **Gender**: Male/Female classification with confidence scores\n- **Race/Ethnicity**: Classification across multiple categories\n- **Emotion**: Detection of facial expressions (happy, sad, angry, etc.)\n\n### Image Input Formats\n\nThe API accepts images in the following formats:\n1. **File Upload**: Direct file upload via multipart form\n2. **Base64**: Base64-encoded image string (with or without data URL prefix)\n\n### Image Optimization\n\nImages are automatically optimized to reduce size while preserving\nessential details for accurate analysis. You can control optimization\nparameters or disable it entirely.\n\n### Token Counting\n\nEach response includes token count information for both input (image)\nand output (results). This is in
@9Dave9
9Dave9 / gist:46c151d3e901d710891997248e70ccc8
Created February 1, 2026 17:05
Example Json object with info from DeepFace analysis - JSON
{
"success": true,
"data": {
"faces": [
{
"face_id": 1,
"region": {
"x": 138,
"y": 102,
"w": 213,
@9Dave9
9Dave9 / gist:72b87b99cee7e33ebc3b8dd2f25b3e23
Created February 1, 2026 16:28
openAPI for deep face recognition.json
{
"openapi": "3.1.0",
"info": {
"title": "Deep-Emo API",
"description": "\n## Human Attribute and Emotion Identifier API\n\nThis API provides facial attribute analysis using the DeepFace library.\nIt can detect and analyze:\n\n- **Age**: Estimated age in years\n- **Gender**: Male/Female classification with confidence scores\n- **Race/Ethnicity**: Classification across multiple categories\n- **Emotion**: Detection of facial expressions (happy, sad, angry, etc.)\n\n### Image Input Formats\n\nThe API accepts images in the following formats:\n1. **File Upload**: Direct file upload via multipart form\n2. **Base64**: Base64-encoded image string (with or without data URL prefix)\n\n### Image Optimization\n\nImages are automatically optimized to reduce size while preserving\nessential details for accurate analysis. You can control optimization\nparameters or disable it entirely.\n\n### Token Counting\n\nEach response includes token count information for both input (image)\nand output (results). This is in
chart = {
const width = 928;
const height = width;
const innerRadius = 180;
const outerRadius = Math.min(width, height) / 2;
// Stack the data into series by age
const series = d3.stack()
.keys(d3.union(data.map(d => d.age))) // distinct series keys, in input order
.value(([, D], key) => D.get(key).population) // get value for each series key and stack
(function() {
'use strict';
// map viewport dimensions
var width = 460,
height = 650;
// create a scale of colours for each party, so we can map results to constituency segments
var quantize = d3.scale.quantize()
.domain([1, 11])
@9Dave9
9Dave9 / gist:2ad73f8de7ee7893dc8d179872319b3d
Created December 10, 2025 17:25
Versions http response
{
"items": [
{
"alerts": [],
"collection_id": "cmdweeklydeathsbyregion-4c59ec99571265d18ea4812ce6663bdf22f9030a27463fc77c59134ab470ef51",
"dataset_id": "weekly-deaths-region",
"dimensions": [
{
"label": "Time",
"links": {
@9Dave9
9Dave9 / gist:73b76682330368f065548c07ed4514bb
Created December 10, 2025 02:10
Options from dimensions - to get human readable locations instead of codes
{
"items": [
{
"label": "England",
"links": {
"code": {
"href": "https://api.beta.ons.gov.uk/v1/code-lists/administrative-geography/codes/E92000001",
"id": "E92000001"
},
"code_list": {
{
"items": [
{
"edition": "dummy_edition_1",
"id": "dummy_id_1",
"links": {
"dataset": {
"href": "https://example.com/dummy/dataset",
"id": "dummy_dataset"
},
@9Dave9
9Dave9 / gist:768eac02ad25bf04ed13b48bb4533e0e
Last active December 9, 2025 20:37
Dimensions response example
{
"items": [
{
"label": "dummy_label_1",
"links": {
"code_list": {
"href": "https://example.com/dummy/code-list-1",
"id": "dummy_code_list_1"
},
"options": {