Git Product home page Git Product logo

bib-tagger's Introduction

bib-tagger

A project for parsing race photos and identifying bib numbers.

bib-tagger will read in a directory of photos and attempt to identify each visible bib number.

pipeline

  • face detection, body detection
  • bib detection
  • SWT on bib
  • OCR on SWT results

Dependencies

Probably could stand to clean these up a bit, do we need all of these? *Scipy *Numpy *pytesseract **tesseract-ocr *Pillow

Usage

Main.py will run through all of the file in a directory labeled 'photos'. modify tests\test_bibtagger.py to test the entire pipeline on a single file.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

ToDo

  • Refining SWT & OCR based on smaller problem set of bib detection
  • Create results hash map

Credits

First version created by KateRita & Ryanr23

bib-tagger's People

Contributors

katerita avatar ryanr23 avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bib-tagger's Issues

How to find a RBN box?

Good day.
I received not so good result, now I'm trying to research about the project and code something better, but I can’t understand how does SWT algorithm works and how you received a box with the number(RBN). Could you please describe?
Thank you for your attention.
Good bye!

Doesn't Correctly Identify Bibs on Sample Images

I cloned the repo and ran the code, but it is not correctly identifying the bibs. Here is the output


Michaels-iMac:bib-tagger michael$ python main.py 
Searching for image folders in /Users/michael/Documents/Developer/Python/bib-tagger/photos folder
Collecting images from directory Frosty5k
Extracting bibs.
=======================================
Processing Image:  ('Frosty5k', '1.jpg')
Found 1 bodies!
0.856932
/Users/michael/Documents/Developer/Python/bib-tagger/bibtagger/swt.py:79: RuntimeWarning: invalid value encountered in true_divide
  grad_x_g = step_x_g / mag_g
/Users/michael/Documents/Developer/Python/bib-tagger/bibtagger/swt.py:80: RuntimeWarning: invalid value encountered in true_divide
  grad_y_g = step_y_g / mag_g
1.062268
2.616008
4.43
Result: 1 faces, 1 bibs, 0 SWT, 1 bib numbers: (['443'])
=======================================
Processing Image:  ('Frosty5k', '2.jpg')
Found 2 bodies!
4.686152
4.926471
6.687606
53 .
8.346033
8.672481
11.097825
1 25
Result: 2 faces, 1 bibs, 0 SWT, 2 bib numbers: (['53', '125'])
=======================================
Processing Image:  ('Frosty5k', '3.jpg')
Found 1 bodies!
13.088198

14.971595

17.342941
732
Result: 1 faces, 1 bibs, 0 SWT, 1 bib numbers: (['732'])
=======================================
Processing Image:  ('Frosty5k', '4.jpg')
Found 3 bodies!
19.198021

19.621269

22.012276
177
23.756217

25.285232

27.524981
131
28.83732

29.817338

33.595866
-375
Result: 3 faces, 3 bibs, 0 SWT, 3 bib numbers: (['177', '131', '375'])
=======================================
Processing Image:  ('Frosty5k', '5.jpg')
Found 3 bodies!
37.081567
37.784887

39.431238
1211
40.283858
3
42.352267
1 4
Result: 3 faces, 1 bibs, 0 SWT, 3 bib numbers: (['1211', '3', '14'])
=======================================
Processing Image:  ('Frosty5k', '6.jpg')
Found 4 bodies!
46.196382

47.380527

51.95717

53.607039

54.132104

56.781109
.5
59.234034

61.504055
18.9
64.773113
1 1
Result: 4 faces, 0 bibs, 0 SWT, 3 bib numbers: (['5', '189', '11'])
=======================================
Processing Image:  ('Frosty5k', 'bib.jpg')
Found 1 bodies!
68.276262
2
Result: 1 faces, 0 bibs, 0 SWT, 1 bib numbers: (['2'])
Collecting images from directory GloryDays
Extracting bibs.
=======================================
Processing Image:  ('GloryDays', '1.jpg')
Found 2 bodies!
69.632925
69.768516
70.736912
1
71.623225
3553
Result: 2 faces, 1 bibs, 0 SWT, 2 bib numbers: (['1', '3553'])
=======================================
Processing Image:  ('GloryDays', '2.jpg')
Found 1 bodies!
73.573601
35 31
Result: 1 faces, 0 bibs, 0 SWT, 1 bib numbers: (['3531'])
=======================================
Processing Image:  ('GloryDays', '3.jpg')
Found 1 bodies!
76.312287
3731
Result: 1 faces, 1 bibs, 0 SWT, 1 bib numbers: (['3731'])
=======================================
Processing Image:  ('GloryDays', '4.jpg')
Found 1 bodies!
77.545362
3 9
Result: 1 faces, 1 bibs, 0 SWT, 1 bib numbers: (['39'])
=======================================
Processing Image:  ('GloryDays', 'bib-sample.jpg')
Found 0 bodies!
Result: 0 faces, 0 bibs, 0 SWT, 0 bib numbers: ([])
=======================================
FINAL STATS
Faces: 20
Bibs: 10
SWT: 0
Bib Numbers: 19
('Bib Index: ',
 {'1': [('GloryDays',
         '1.jpg')],
  '11': [('Frosty5k',
          '6.jpg')],
  '1211': [('Frosty5k',
            '5.jpg')],
  '125': [('Frosty5k',
           '2.jpg')],
  '131': [('Frosty5k',
           '4.jpg')],
  '14': [('Frosty5k',
          '5.jpg')],
  '177': [('Frosty5k',
           '4.jpg')],
  '189': [('Frosty5k',
           '6.jpg')],
  '2': [('Frosty5k',
         'bib.jpg')],
  '3': [('Frosty5k',
         '5.jpg')],
  '3531': [('GloryDays',
            '2.jpg')],
  '3553': [('GloryDays',
            '1.jpg')],
  '3731': [('GloryDays',
            '3.jpg')],
  '375': [('Frosty5k',
           '4.jpg')],
  '39': [('GloryDays',
          '4.jpg')],
  '443': [('Frosty5k',
           '1.jpg')],
  '5': [('Frosty5k',
         '6.jpg')],
  '53': [('Frosty5k',
          '2.jpg')],
  '732': [('Frosty5k',
           '3.jpg')]})

ValueError: too many values to unpack

I just installed the program and got the following error:

usera@desktop-VBox:~/bib-tagger$ python main.py
Searching for image folders in /home/usera/bib-tagger/photos folder
Collecting images from directory Frosty5k
Extracting bibs.
===1====================================
Processing Image: ('Frosty5k', '1.jpg')
Found 1 bodies!
Traceback (most recent call last):
File "main.py", line 44, in
results.append(bt.findBibs(image,os.path.join(outfolder,img_namelist[idx][0],img_namelist[idx][1])))
File "/home/usera/bib-tagger/bibtagger/bibtagger.py", line 34, in findBibs
bibs = [ Bib(image, bodybox) for bodybox in bodyboxes ]
File "/home/usera/bib-tagger/bibtagger/bib.py", line 10, in init
self.corners = bf.find_bib(self.body_image())
File "/home/usera/bib-tagger/bibtagger/find_bibs.py", line 23, in find_bib
threshold_contours,hierarchy = find_contours(binary)
ValueError: too many values to unpack

==================

Anything wrong I did ?

Thanks a lot

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.