Instructions to use oliver0804/LocateAnything-3B-RK3588 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- RKLLM
How to use oliver0804/LocateAnything-3B-RK3588 with RKLLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download tools/eval_board.py from oliver0804/LocateAnything-3B-RK3588: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/oliver0804/LocateAnything-3B-RK3588/resolve/main/tools/eval_board.py
- Command line
-
hf download hf://oliver0804/LocateAnything-3B-RK3588/tools/eval_board.py
-
curl -L -o eval_board.py https://huggingface.co/oliver0804/LocateAnything-3B-RK3588/resolve/main/tools/eval_board.py
1.12 kB
| import json, os, sys, time | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, os.path.join(HERE, "..", "rk3588")) | |
| EVAL = os.environ.get("EVAL_DIR", os.path.join(HERE, "eval")) | |
| from PIL import Image | |
| import locate3b as L | |
| S = json.load(open(EVAL + "/eval_set.json")) | |
| loc = L.Locator() | |
| out = {} | |
| t0 = time.time() | |
| for k, s in enumerate(S): | |
| img = Image.open(EVAL + "/" + s["file"]) | |
| q = "Locate all the instances that matches the following description: %s." % s["cat"] | |
| t = time.time() | |
| try: | |
| text, st = loc.locate(img, q, max_new=400, rep_penalty=1.1, max_boxes=100, dedupe_iou=0.85, temperature=0.7, top_p=0.9, seed=0) | |
| except Exception as e: | |
| text, st = "ERROR %r" % e, {} | |
| out[str(s["id"])] = {"text": text, "sec": round(time.time() - t, 2), "stats": st} | |
| if k % 10 == 0: | |
| print(k, "%.0fs" % (time.time() - t0), flush=True) | |
| json.dump(out, open(EVAL + "/preds_board_sampled.json", "w"), ensure_ascii=False) | |
| json.dump(out, open(EVAL + "/preds_board_sampled.json", "w"), ensure_ascii=False) | |
| loc.close(); print("BOARD DONE", "%.0fs" % (time.time() - t0)) | |