what is this
diablo 2 vision system is a library to assist with the automation of d2, using only pixels, keyboard and mouse
installation
$ pip install d2vs
NOTE: this can run via CPU, but via GPU is far superior. You must install CUDA and the appropriate python jazz to get that working, for me with CUDA10.1:
$ conda install torch torchvision cudatoolkit=10.1 -c pytorch
usage
(586_gold.png)
import numpy as np
from d2vs.ocr import OCR
from PIL import Image
# Initiate OCR
ocr = OCR()
# Load an Image
img = Image.open("586_gold.png")
# Scan the image
bounds, text, item_type = ocr.read(img)
# Print out the data for demo purposes
top_left, top_right, bottom_right, bottom_left = bounds
print(top_left, top_right, bottom_right, bottom_left)
# ([2, 2], [158, 2], [158, 32], [2, 32])
print(text)
# '586 Gold'
print(item_type)
# 'Normal'
project goals
- Have fun automating single player! Not for profit
- OCR with near 100% accuracy
- Visually determine where you are in game, area level and world coordinate system
- Click from world coords to screen coords
- Path through unexplored areas to a goal
- Facilitate complete d2 bot from lvl 1 to 99
- Pick it
an example map reading from d2vs of black marsh
nodes for the static map Harrogath
development
setup
$ git clone ...
$ pip install -r requirements.dev.txt
running tests
$ pytest
distributing
$ python setup.py sdist bdist_wheel
$ twine upload dist/*
Metadata
Release files for d2vs 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| d2vs-0.0.3.tar.gz | 14.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| d2vs-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.1 MB
Release files / d2vs-0.0.3.tar.gz
| Download URL | d2vs-0.0.3.tar.gz |
|---|---|
| Size | 14.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81c4170e54d43e8d3eb2e097d38489372afd9e637da0cc3801c55fc5255d605a
|
|
BLAKE2b-256 checksum How to use checksums |
0967513ebb15ccd3941cd4adb0558430a0a3fd8988df8d11d15c957d4935625e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
|
Release files / d2vs-0.0.3-py3-none-any.whl
| Download URL | d2vs-0.0.3-py3-none-any.whl |
|---|---|
| Size | 14.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19f3fd9339cd2e764064748e54fd28e6d183453946e5cb2cf59b016adb4e7bc6
|
|
BLAKE2b-256 checksum How to use checksums |
4382198c9ca0c415e739796d612bf3b9f9072ff4146e9994c902eb6a429cca7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
|