Coder Social home page Coder Social logo

wmcnally / deep-darts Goto Github PK

View Code? Open in Web Editor NEW
100.0 12.0 35.0 1.32 MB

DeepDarts is the first deep learning-based automatic scoring system for steel-tip darts. It predicts dart scores from a single image taken from any camera angle.

Python 100.00%
deep-learning tensorflow tensorflow2 darts darts-scoring

deep-darts's Introduction

DeepDarts

Code for the CVSports 2021 paper: DeepDarts: Modeling Keypoints as Objects for Automatic Scorekeeping in Darts using a Single Camera

Prerequisites

Python 3.5-3.8, CUDA >= 10.1, cuDNN >= 7.6

Setup

  1. Install Anaconda or Miniconda
  2. Create a new conda environment with Python 3.7: $ conda create -n deep-darts python==3.7. Activate the environment: $ conda activate deep-darts
  3. Clone this repo: $ git clone https://github.com/wmcnally/deep-darts.git
  4. Go into the directory and install the dependencies: $ cd deep-darts && pip install -r requirements.txt
  5. Download images.zip from IEEE Dataport and extract in the dataset directory. Crop the images: $ python crop_images.py --size 800. This step could take a while. Alternatively, you can download the 800x800 cropped images directly from IEEE Dataport. If you choose this option, extract cropped_images.zip in the dataset directory.
  6. Download models.zip from IEEE Dataport and extract in the main directory.

Validation / Testing

To test the Dataset 1 model:
$ python predict.py --cfg deepdarts_d1 --split test

To test the Dataset 2 model and write the prediction images:
$ python predict.py --cfg deepdarts_d2 --split test --write

Training

To train the Dataset 1 model:
$ python train.py --cfg deepdarts_d1

To train the Dataset 2 model:
$ python train.py --cfg deepdarts_d2

You may need to adjust the batch sizes to fit your total GPU memory. The default batch sizes are for 24 GB total GPU memory.

Sample Test Predictions

Dataset 1:
alt text

Dataset 2:
alt text

deep-darts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-darts's Issues

AttributeError: Can't get attribute 'new_block' on <module 'pandas.core.internals.blocks'

Getting an error running the mentioned train command in the README.md file. Command: python train.py --cfg deepdarts_d1

(deep-darts) C:\Users\phroz\development\deep-darts>python train.py --cfg deepdarts_d1
Running on CPU
Number of accelerators:  1
WARNING:tensorflow:Skipping loading of weights for layer PANetTiny due to mismatch in shape ((1, 1, 512, 30) vs (1, 1, 512, 255)).
WARNING:tensorflow:Skipping loading of weights for layer PANetTiny due to mismatch in shape ((30,) vs (255,)).
WARNING:tensorflow:Skipping loading of weights for layer PANetTiny due to mismatch in shape ((1, 1, 256, 30) vs (1, 1, 256, 255)).
WARNING:tensorflow:Skipping loading of weights for layer PANetTiny due to mismatch in shape ((30,) vs (255,)).
Traceback (most recent call last):
  File "train.py", line 152, in <module>
    yolo = train(cfg, strategy)
  File "train.py", line 99, in train
    batch_size=cfg.train.batch_size * strategy.num_replicas_in_sync)
  File "C:\Users\phroz\development\deep-darts\dataloader.py", line 258, in load_tfds
    data = get_splits(cfg.data.labels_path, cfg.data.dataset, split)
  File "C:\Users\phroz\development\deep-darts\dataloader.py", line 34, in get_splits
    df = pd.read_pickle(path)
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\site-packages\pandas\io\pickle.py", line 187, in read_pickle
    return pc.load(f, encoding=None)
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\site-packages\pandas\compat\pickle_compat.py", line 249, in load
    return up.load()
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\pickle.py", line 1085, in load
    dispatch[key[0]](self)
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\pickle.py", line 1382, in load_stack_global
    self.append(self.find_class(module, name))
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\site-packages\pandas\compat\pickle_compat.py", line 189, in find_class
    return super().find_class(module, name)
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\pickle.py", line 1425, in find_class
    return _getattribute(sys.modules[module], name)[0]
  File "C:\Users\phroz\.conda\envs\deep-darts\lib\pickle.py", line 299, in _getattribute
    .format(name, obj)) from None
AttributeError: Can't get attribute 'new_block' on <module 'pandas.core.internals.blocks' from 'C:\\Users\\phroz\\.conda\\envs\\deep-darts\\lib\\site-packages\\pandas\\core\\internals\\blocks.py'>

Data preparation

Could you tell in more detail about the flow from scratch (data preparation) like the keypoint detection one?

Trained model

Hi there,

is there a chance to get a trained model ?

best

Predict an image

Hi,

How can this be used to predict from an image taken by me?

Kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.