Code Monkey home page Code Monkey logo

lego-color's Introduction

Lego Color Classification Model

lego pieces with color predictions

Dataset

  • 42 colors, including most/all of the common colors
  • real photos on white printer paper
  • labeled with Rebrickable.com color ids
  • high confidence they are tagged correctly

Stats

Class:  # Train   # Val   Total
------  -------   -----   -----
0    :      261      64     325
1    :      195      51     246
2    :      237      53     290
3    :      197      54     251
4    :      316      77     393
5    :      207      54     261
10   :      313      86     399
14   :      239      64     303
15   :      305      73     378
19   :      199      49     248
25   :      273      67     340
26   :      135      25     160
27   :      292      71     363
28   :      239      56     295
29   :      243      67     310
30   :      227      57     284
31   :      170      50     220
41   :      192      44     236
46   :      113      22     135
47   :      104      25     129
70   :      169      49     218
71   :      209      51     260
72   :      210      48     258
73   :      336      75     411
84   :      144      23     167
85   :      197      58     255
158  :      102      27     129
182  :       37      10      47
191  :      253      58     311
212  :      200      50     250
226  :      243      83     326
272  :      255      63     318
288  :      299      79     378
308  :       91      22     113
320  :      185      49     234
321  :      223      46     269
322  :      204      54     258
323  :      110      22     132
326  :      312      58     370
378  :       39      14      53
484  :      168      29     197
1050 :      205      58     263
------  -------   -----   -----
Total      8648    2135   10783

Future

  • more colors
  • vary the background
  • printed parts

Do it yourself

# gather source data
# take sheet of white US letter paper
# divide into 9 cells
# assign each cell a color
# optionally label each cell with a pen
# put lego pieces matching the color into the cells, do not overlap piecs, do not overlap cell boundaries (give yourself some margin)
# take a photo, move a little ways away to minimize fisheye
# crop/rotate photo to just the sheet of paper
# put into ./src/images and include the Rebrickable Color IDs in the filename separated by dashes, left-to-right, top-to-bottom
#   e.g. whatever-you-want.1-2-3-4-5-6-7-8-9.png

# generate dataset (see intermediate output in ./tmp)
python dataset.py

# optionally get on Paperspace.com
aws s3 cp datasets/lego-color-common-5k-dataset-4-baseline-plus-renders.zip s3://brian-lego-public/lego-color/
wget https://brian-lego-public.s3.us-west-1.amazonaws.com/lego-color/lego-color-common-5k-dataset-4-baseline-plus-renders.zip

# train
python train.py

lego-color's People

Contributors

brianlow avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.