Skip to content

Instantly share code, notes, and snippets.

@eddyxu
Last active January 29, 2022 19:53
Show Gist options
  • Save eddyxu/4fa8b3a88f13b7951461fb0d4a4b134a to your computer and use it in GitHub Desktop.
Save eddyxu/4fa8b3a88f13b7951461fb0d4a4b134a to your computer and use it in GitHub Desktop.
SELECT
coco_name(detection.label_id) as label,
count(detection.label_id) AS cnt
FROM (
SELECT
explode(ML_PREDICT(ssd, image)) AS detection
FROM coco
) WHERE coco_name(detection.label_id) IN ('person', 'chair', 'remote', 'cell phone', 'sheep', 'cow')
GROUP BY detection.label_id
ORDER BY cnt DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment