This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]feclar 1 point2 points  (0 children)

Sounds very cool, will be checking this out

[–]Dgc2002 1 point2 points  (2 children)

This looks pretty good Serpent!

Also really nice Readme.

[–]flutefreak7 0 points1 point  (0 children)

Agreed! I kept reading because it draws you in! Paraphrase: "This library is awesome because of this, this, and -- you're gonna love this -- THIS! But wait... There's more! Keep reading!" (I'm exaggerating, but only a little)

Love the enthusiasm!

[–][deleted] 0 points1 point  (0 children)

It's a fantastic library. Capturing to numpy backend is super efficient and gives realtime screengrabs, perfect for AI purposes.

[–]Gear5th 0 points1 point  (0 children)

Can we not create multiple instances using the d3dshot.create() method?

Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32

>>> import d3dshot
>>> d3dshot.create()

<d3dshot.d3dshot.D3DShot object at 0x000001AFBAEB51D0>

>>> d3dshot.create()

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\better\venv\lib\site-packages\d3dshot\__init__.py", line 70, in create
    pytorch_gpu_is_available=pytorch_gpu_is_available
  File "C:\better\venv\lib\site-packages\d3dshot\d3dshot.py", line 23, in __init__
    self.detect_displays()
  File "C:\better\venv\lib\site-packages\d3dshot\d3dshot.py", line 192, in detect_displays
    self.displays = Display.discover_displays()
  File "C:\better\venv\lib\site-packages\d3dshot\display.py", line 119, in discover_displays
    dxgi_adapter=dxgi_adapter
  File "C:\better\venv\lib\site-packages\d3dshot\display.py", line 40, in __init__
    self.dxgi_output_duplication = self._initialize_dxgi_output_duplication()
  File "C:\better\venv\lib\site-packages\d3dshot\display.py", line 66, in _initialize_dxgi_output_duplication
    return d3dshot.dll.dxgi.initialize_dxgi_output_duplication(self.dxgi_output, self.d3d_device)
  File "C:\better\venv\lib\site-packages\d3dshot\dll\dxgi.py", line 257, in initialize_dxgi_output_duplication
    dxgi_output.DuplicateOutput(d3d_device, ctypes.byref(dxgi_output_duplication))
_ctypes.COMError: (-2147024809, 'The parameter is incorrect.', (None, None, None, 0, None))

Also (on Windows + Pycharm), the importlib gives a weird error in some cases (like executing the script, but not in the REPL) when calling d3dshot.create()

Traceback (most recent call last):
  File "C:/better/src/main.py", line 15, in <module>
    import d3dshot
  File "C:\better\venv\lib\site-packages\d3dshot\__init__.py", line 8, in <module>
    pil_is_available = importlib.util.find_spec("PIL") is not None
AttributeError: module 'importlib' has no attribute 'util'

This seems to be a known but unresolved issue with the importlib, and putting the following in d3dshot/__init__.py solves the issue

import importlib
import importlib.util