PixelOne / runtime /README.md
KangHui2200's picture
Correct PixelOne repository links and connect the data release
ae85b97 verified
|
Raw History Blame Contribute Delete
2.49 kB

PixelOne inference runtime

One inference-only package supports both PixelOne-Pro-4B and PixelOne-Pro-35B-A3B. Training, teacher search, dataset preparation and checkpoint export live in the GitHub research repository, not in this runtime.

Install

Use Python 3.12 with CUDA-enabled PyTorch 2.11. The released mixed-precision weights require CUDA. Authenticate with hf auth login if the model repository is private.

python -m pip install -U huggingface_hub
hf download KangHui2200/PixelOne --include 'runtime/*' --local-dir ./PixelOne
python -m pip install ./PixelOne/runtime
python -m pip install flash-linear-attention==0.4.2 causal-conv1d==1.7.0 --no-build-isolation

The inference-only distribution and the full GitHub package use the same pixelone-grounding package name and API version. Install one in a dedicated environment, not both together. Pin the Hugging Face commit with hf download --revision COMMIT and the loader's revision argument for reproducibility.

Predict

pixelone infer --model KangHui2200/PixelOne --subfolder PixelOne-Pro-4B \
  --image screenshot.png --instruction "Click the search button" --device cuda:0
from PIL import Image
from pixelone import PixelOnePredictor

predictor = PixelOnePredictor.from_pretrained(
    "KangHui2200/PixelOne", subfolder="PixelOne-Pro-4B", device="cuda:0",
)
with Image.open("screenshot.png") as screenshot:
    result = predictor.predict(screenshot, "Click the search button")
print(result["point"])

Use PixelOne-Pro-35B-A3B for the larger model. The loader downloads only the selected model's required files. For offline inference, download the shared runtime/* and the selected model directory, install the runtime, then pass the local model directory to the loader.

Coordinates are original-image pixel centers. Screenshots are padded to stride 32, never silently resized. The decoder selects a token first and then a valid pixel inside it. Keep the loader's BF16/FP32 partition and native attention/kernel settings; do not cast the whole model to BF16 or FP16. kernel_backend="torch" is a diagnostic alternative, not the paper's latency configuration.

The seven videojev_hf modules retain the upstream architecture and its internal dependencies. They are required by the custom model, not a second training package. Licenses and attribution are included in THIRD_PARTY_NOTICES.md and third_party/.