{"id":19082269,"url":"https://github.com/waikato-datamining/opex4j","last_synced_at":"2026-04-28T18:02:01.766Z","repository":{"id":216010109,"uuid":"607342930","full_name":"waikato-datamining/opex4j","owner":"waikato-datamining","description":"Java library for the OPEX JSON format.","archived":false,"fork":false,"pushed_at":"2025-04-29T03:37:57.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-03T14:15:22.120Z","etag":null,"topics":["java","json","object-detection"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waikato-datamining.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-27T19:51:19.000Z","updated_at":"2025-04-29T03:38:00.000Z","dependencies_parsed_at":"2024-11-09T02:42:53.211Z","dependency_job_id":"2b88c509-3bb4-4597-9a55-b086457efc2b","html_url":"https://github.com/waikato-datamining/opex4j","commit_stats":null,"previous_names":["waikato-datamining/opex4j"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/waikato-datamining/opex4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fopex4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fopex4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fopex4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fopex4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waikato-datamining","download_url":"https://codeload.github.com/waikato-datamining/opex4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waikato-datamining%2Fopex4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","json","object-detection"],"created_at":"2024-11-09T02:42:46.627Z","updated_at":"2026-04-28T18:02:01.750Z","avatar_url":"https://github.com/waikato-datamining.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opex4j\nJava library for the [OPEX JSON format](https://github.com/WaikatoLink2020/objdet-predictions-exchange-format)\n(faster Python alternative: [fast-opex](https://github.com/waikato-datamining/fast-opex)).\n\n## JSON\n\nHere is an [example](src/test/resources/opex4j/simple.json):\n\n```json\n{\n  \"timestamp\": \"...\",\n  \"id\": \"str\",\n  \"objects\": [\n    {\n      \"score\": 1.0,\n      \"label\": \"person\",\n      \"bbox\": {\n        \"top\": 100,\n        \"left\": 100,\n        \"bottom\": 150,\n        \"right\": 120\n      },\n      \"polygon\": {\n        \"points\": [\n          [100, 100],\n          [150, 100],\n          [150, 120],\n          [100, 120]\n        ]\n      }\n    },\n    {\n      \"score\": 0.95,\n      \"label\": \"house\",\n      \"bbox\": {\n        \"top\": 100,\n        \"left\": 100,\n        \"bottom\": 200,\n        \"right\": 200\n      },\n      \"polygon\": {\n        \"points\": [\n          [100, 100],\n          [200, 100],\n          [200, 200],\n          [100, 200]\n        ]\n      },\n      \"meta\": {\n        \"price\": \"500k\"\n      }\n    }\n  ],\n  \"meta\": {\n    \"key1\": \"value1\",\n    \"key2\": \"value2\"\n  }\n}\n```\n\n**Notes:**\n\n* supported timestamp formats: `yyyyMMdd_HHmmss.SSSSSS` and `yyyy-MM-dd HH:mm:ss.SSSSSS`\n\n\n## Reading/Writing\n\nTo read predictions:\n\n```java\nimport opex4j.ObjectPredictions;\nimport java.io.InputStream;\nimport java.io.File;\nimport java.io.Reader;\n\npublic class Examples {\n\n  public static void main(String[] args) throws Exception {\n    // from string\n    ObjectPredictions preds = ObjectPredictions.newInstance(\"{...}\");\n\n    // from file\n    ObjectPredictions preds = ObjectPredictions.newInstance(new File(\"predictions.json\"));\n\n    // from reader\n    Reader reader = ...;\n    ObjectPredictions preds = ObjectPredictions.newInstance(reader);\n    reader.close();\n \n    // from stream\n    InputStream stream = ...;\n    ObjectPredictions preds = ObjectPredictions.newInstance(stream);\n    stream.close();\n  }\n}\n```\n\nTo write predictions:\n\n```java\nimport opex4j.ObjectPredictions;\nimport java.io.File;\nimport java.io.OutputStream;\nimport java.io.Writer;\n\npublic class Examples {\n\n  public static void main(String[] args) throws Exception {\n    ObjectPredictions preds = ...;\n\n    // to string (not pretty printed)\n    String s = preds.toString(false);\n\n    // to file (pretty printed, implicitly)\n    ObjectPredictions.write(new File(\"predictions.json\"));\n\n    // to writer (pretty printed, explicitly)\n    Writer writer = ...;\n    ObjectPredictions.write(writer, true);\n    writer.close();\n \n    // to stream (not pretty printed)\n    OutputStream stream = ...;\n    preds.write(stream, false);\n    stream.close();\n  }\n}\n```\n\n\n## Maven\n\nUse the following dependency in your `pom.xml`:\n\n```xml\n    \u003cdependency\u003e\n      \u003cgroupId\u003enz.ac.waikato.cms.adams\u003c/groupId\u003e\n      \u003cartifactId\u003eopex4j\u003c/artifactId\u003e\n      \u003cversion\u003e0.0.3\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fopex4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaikato-datamining%2Fopex4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaikato-datamining%2Fopex4j/lists"}