lets-go-programming-cryptopunks

所属分类:区块链开发
开发工具:GO
文件大小:1360KB
下载次数:0
上传日期:2022-10-27 15:47:36
上 传 者sh-1993
说明:  让我们开始编程加密朋克,让我们开始!编程(加密)像素朋克个人资料图片和(生成)艺术与Go-一步一步的书籍指南Ins...
(Let s Go! Programming (Crypto) Pixel Punk Profile Pictures & (Generative) Art with Go - Step-by-Step Book / Guide Inside Unique 24×24 Pixel Art on the Blockchain...)

文件列表:
01_tile (0, 2022-10-27)
01_tile\main.go (2461, 2022-10-27)
01_tile_(gophers) (0, 2022-10-27)
01_tile_(gophers)\main.go (1605, 2022-10-27)
02_generate (0, 2022-10-27)
02_generate\main.go (2922, 2022-10-27)
A1_generate (0, 2022-10-27)
A1_generate\main.go (1876, 2022-10-27)
A2_generate (0, 2022-10-27)
A2_generate\main.go (1751, 2022-10-27)
B1_export (0, 2022-10-27)
B1_export\attributes.csv (4947, 2022-10-27)
B1_export\main.go (2713, 2022-10-27)
LICENSE.md (6555, 2022-10-27)
NOTES.md (177, 2022-10-27)
basic (0, 2022-10-27)
basic\alien.png (204, 2022-10-27)
basic\ape.png (216, 2022-10-27)
basic\f (0, 2022-10-27)
basic\f\3dglasses.png (133, 2022-10-27)
basic\f\bandana.png (148, 2022-10-27)
basic\f\bigshades.png (150, 2022-10-27)
basic\f\blacklipstick.png (91, 2022-10-27)
basic\f\blondebob.png (149, 2022-10-27)
basic\f\blondeshort.png (137, 2022-10-27)
basic\f\blueeyeshadow.png (112, 2022-10-27)
basic\f\cap.png (137, 2022-10-27)
basic\f\choker.png (97, 2022-10-27)
basic\f\cigarette.png (147, 2022-10-27)
basic\f\classicshades.png (135, 2022-10-27)
basic\f\clowneyesblue.png (144, 2022-10-27)
basic\f\clowneyesgreen.png (144, 2022-10-27)
basic\f\clownhairgreen.png (171, 2022-10-27)
basic\f\clownnose.png (110, 2022-10-27)
basic\f\crazyhair.png (161, 2022-10-27)
... ...

# Let's Go! Programming (Crypto) Pixel Punk Profile Pictures & (Generative) Art with Go - Step-by-Step Book / Guide _Inside Unique 24×24 Pixel Art on the Blockchain..._ by [Gerald Bauer](https://github.com/geraldb), et al # 1 ## Do-It-Yourself (DIY) - Yes, You Can! - Mint Your Own Punks in Original 24x24 Pixel Format or With 2X / 4X / 8X Zoom ### Step 0 - Download a punks all-in-one composite image / collection One time / first time only - Download a punks pixel art collection from the [Awesome 24px Downloads - Free Pixel Art Collections in the 24x24 Format](https://github.com/cryptopunksnotdead/awesome-24px) page. Let's try the 1000 More Punks collection in a single all-in-one 600×960px image (~180 kb) for free. See ![](i/morepunks-strip.png) [`morepunks.png` ](https://github.com/cryptopunksnotdead/awesome-24px/blob/master/collection/morepunks.png) Let's create a program to mint (more) punk pixel art images. Let's (re)use the pixelart package from the [learn pixel art org](https://github.com/learnpixelart/pixelart.go). ### Step 1 - Read punk composite image ``` go package main import ( "fmt" "github.com/learnpixelart/pixelart.go/pixelart" ) func main() { fmt.Printf( "Hello, Pixel Art v%s!\n", pixelart.Version ) path := "./morepunks.png" tileSize := pixelart.Point{24, 24} punks := pixelart.ReadImageComposite( path, &tileSize ) fmt.Println( punks.Bounds() ) //=> (0,0)-(600,960) } ``` ### Step 2 - Start minting Note: By default punks get saved in the original 24x24 pixel format and the first punk starts at index zero, that is, `0`. running up to 999. Let's mint punk #0, #18, #40, and #88. Add inside `func main()`: ``` go punk := punks.Tile( 0 ) fmt.Println( punk.Bounds() ) //=> (0,0)-(24,24) punk.Save( "./morepunk0.png" ) punks.Tile( 18 ).Save( "./morepunk18.png" ) punks.Tile( 40 ).Save( "./morepunk40.png" ) punks.Tile( 88 ).Save( "./morepunk88.png" ) ``` And voila! ![](i/morepunk0.png) ![](i/morepunk18.png) ![](i/morepunk40.png) ![](i/morepunk88.png) Let's change the zoom factor: ``` go punks.Tile( 0 ).Zoom( 4 ).Save( "./morepunk0@4x.png" ) punks.Tile( 18 ).Zoom( 4 ).Save( "./morepunk18@4x.png" ) punks.Tile( 40 ).Zoom( 4 ).Save( "./morepunk40@4x.png" ) punks.Tile( 88 ).Zoom( 4 ).Save( "./morepunk88@4x.png" ) ``` And voila in 4x! ![](i/morepunk0@4x.png) ![](i/morepunk18@4x.png) ![](i/morepunk40@4x.png) ![](i/morepunk88@4x.png) Proof-of the pudding. If you want to run the ready-made sample program in [**`01_tile/`**](01_tile) yourself try: - Generate a go module (`go.mod`) - Add the pixelart package via go get to `go.mod` - Run the code ``` $ cd 01_tile $ go mod init example.com/01_tile $ go get github.com/learnpixelart/pixelart.go/pixelart $ go run main.go ``` Let's try with the classic gray-ish background in red/green/blue (rgb) as a hexstring `#638596`: ``` go punks.Tile( 0 ).Background( "#638596" ).Zoom( 4 ).Save( "./morepunk0_(grayish)@4x.png" ) punks.Tile( 18 ).Background( "#638596" ).Zoom( 4 ).Save( "./morepunk18_(grayish)@4x.png" ) punks.Tile( 40 ).Background( "#638596" ).Zoom( 4 ).Save( "./morepunk40_(grayish)@4x.png" ) punks.Tile( 88 ).Background( "#638596" ).Zoom( 4 ).Save( "./morepunk88_(grayish)@4x.png" ) ``` And voila! ![](i/morepunk0_(grayish)@4x.png) ![](i/morepunk18_(grayish)@4x.png) ![](i/morepunk40_(grayish)@4x.png) ![](i/morepunk88_(grayish)@4x.png) Philip! Phree the Phunks! Let's try to flip vertically, that is, mirror, the punk images - turning right-looking punks into left-looking. ``` go punks.Tile( 0 ).Background( "#638596" ).Mirror().Zoom( 4 ).Save( "./morephunk0_(grayish)@4x.png" ) punks.Tile( 18 ).Background( "#638596" ).Mirror().Zoom( 4 ).Save( "./morephunk18_(grayish)@4x.png" ) punks.Tile( 40 ).Background( "#638596" ).Mirror().Zoom( 4 ).Save( "./morephunk40_(grayish)@4x.png" ) punks.Tile( 88 ).Background( "#638596" ).Mirror().Zoom( 4 ).Save( "./morephunk88_(grayish)@4x.png" ) ``` And voila! ![](i/morephunk0_(grayish)@4x.png) ![](i/morephunk18_(grayish)@4x.png) ![](i/morephunk40_(grayish)@4x.png) ![](i/morephunk88_(grayish)@4x.png) And so on. Happy miniting. ### Bonus - Glory to Ukraine! Fuck (Vladimir) Putin! Stop the War! - Send A Stop The War Message To The World With Your Profile Picture Let's try the ukraine flag in the background (with the built-in `Ukraine` helper method): ``` go punks.Tile( 0 ).Ukraine().Zoom( 4 ).Save( "./morepunk0_flag(ukraine)@4x.png" ) punks.Tile( 18 ).Ukraine().Zoom( 4 ).Save( "./morepunk18_flag(ukraine)@4x.png" ) punks.Tile( 40 ).Ukraine().Zoom( 4 ).Save( "./morepunk40_flag(ukraine)@4x.png" ) punks.Tile( 88 ).Ukraine().Zoom( 4 ).Save( "./morepunk88_flag(ukraine)@4x.png" ) ``` And voila! ![](i/morepunk0_flag(ukraine)@4x.png) ![](i/morepunk18_flag(ukraine)@4x.png) ![](i/morepunk40_flag(ukraine)@4x.png) ![](i/morepunk88_flag(ukraine)@4x.png) Or try two-colored with the background in blue and the silhouette (foreground) in yellow and vice versa: ``` go punks.Tile( 0 ).Silhouette("#ffdd00").Background("#0057b7").Zoom( 4 ).Save( "./morepunk0_silhouette(ukraine)@4x.png" ) punks.Tile( 18 ).Silhouette("#0057b7").Background("#ffdd00").Zoom( 4 ).Save( "./morepunk18_silhouette(ukraine)@4x.png" ) punks.Tile( 40 ).Silhouette("#ffdd00").Background("#0057b7").Zoom( 4 ).Save( "./morepunk40_silhouette(ukraine)@4x.png" ) punks.Tile( 88 ).Silhouette("#0057b7").Background("#ffdd00").Zoom( 4 ).Save( "./morepunk88_silhouette(ukraine)@4x.png" ) ``` And voila! ![](i/morepunk0_silhouette(ukraine)@4x.png) ![](i/morepunk18_silhouette(ukraine)@4x.png) ![](i/morepunk40_silhouette(ukraine)@4x.png) ![](i/morepunk88_silhouette(ukraine)@4x.png) ## Are Gophers, The New Punks? Let's retry with [**Egon Elbre's gophers collection**](https://github.com/egonelbre/gophers) in the 32x32 pixel format. See the all-in-one composite image with 35 gophers in a 7x5 grid - [`gophers.png`](gophers.png) ![](gophers.png) (~14kb) Let's create a program to mint gopher pixel art images. ### Step 1 - Read gopher composite image ``` go package main import ( "fmt" "github.com/learnpixelart/pixelart.go/pixelart" ) func main() { fmt.Printf( "Hello, Pixel Art v%s!\n", pixelart.Version ) path := "./gophers.png" tileSize := pixelart.Point{32, 32} punks := pixelart.ReadImageComposite( path, &tileSize ) fmt.Println( gophers.Bounds() ) //=> (0,0)-(224,160) } ``` ### Step 2 - Start minting Let's mint gopher #0 (neutral), #1 (pirate), #16 (heart eyes), and #28 (mind blown). Add inside `func main()`: ``` go gopher := gophers.Tile( 0 ) fmt.Println( gopher.Bounds() ) //=> (0,0)-(32,32) gopher.Save( "./gopher0.png" ) gophers.Tile( 1 ).Save( "./gopher1.png" ) gophers.Tile( 16 ).Save( "./gopher16.png" ) gophers.Tile( 28 ).Save( "./gopher28.png" ) ``` And voila! ![](i/gopher0.png) ![](i/gopher1.png) ![](i/gopher16.png) ![](i/gopher28.png) Let's change the zoom factor: ``` go gophers.Tile( 0 ).Zoom( 4 ).Save( "./gopher0@4x.png" ) gophers.Tile( 1 ).Zoom( 4 ).Save( "./gopher1@4x.png" ) gophers.Tile( 16 ).Zoom( 4 ).Save( "./gopher16@4x.png" ) gophers.Tile( 28 ).Zoom( 4 ).Save( "./gopher28@4x.png" ) ``` And voila in 4x! ![](i/gopher0@4x.png) ![](i/gopher1@4x.png) ![](i/gopher16@4x.png) ![](i/gopher28@4x.png) Proof-of the pudding. If you want to run the ready-made sample program in [**`01_tile_(gophers)/`**](01_tile_(gophers)) yourself try: - Generate a go module (`go.mod`) - Add the pixelart package via go get to `go.mod` - Run the code ``` $ cd 01_tile_(gophers) $ go mod init example.com/01_tile $ go get github.com/learnpixelart/pixelart.go/pixelart $ go run main.go ``` Let's try with the classic gray-ish background in red/green/blue (rgb) as a hexstring `#638596`: ``` go gophers.Tile( 0 ).Background( "#638596" ).Zoom( 4 ).Save( "./gopher0_(grayish)@4x.png" ) gophers.Tile( 1 ).Background( "#638596" ).Zoom( 4 ).Save( "./gopher1_(grayish)@4x.png" ) gophers.Tile( 16 ).Background( "#638596" ).Zoom( 4 ).Save( "./gopher16_(grayish)@4x.png" ) gophers.Tile( 28 ).Background( "#638596" ).Zoom( 4 ).Save( "./gopher28_(grayish)@4x.png" ) ``` And voila! ![](i/gopher0_(grayish)@4x.png) ![](i/gopher1_(grayish)@4x.png) ![](i/gopher16_(grayish)@4x.png) ![](i/gopher28_(grayish)@4x.png) ### Bonus - Glory to Ukraine! Fuck (Vladimir) Putin! Stop the War! - Send A Stop The War Message To The World With Your Profile Picture Let's try the ukraine flag in the background (with the built-in `Ukraine` helper method): ``` go gophers.Tile( 0 ).Ukraine().Zoom( 4 ).Save( "./gopher0_flag(ukraine)@4x.png" ) gophers.Tile( 1 ).Ukraine().Zoom( 4 ).Save( "./gopher1_flag(ukraine)@4x.png" ) gophers.Tile( 16 ).Ukraine().Zoom( 4 ).Save( "./gopher16_flag(ukraine)@4x.png" ) gophers.Tile( 28 ).Ukraine().Zoom( 4 ).Save( "./gopher28_flag(ukraine)@4x.png" ) ``` And voila! ![](i/gopher0_flag(ukraine)@4x.png) ![](i/gopher1_flag(ukraine)@4x.png) ![](i/gopher16_flag(ukraine)@4x.png) ![](i/gopher28_flag(ukraine)@4x.png) # 2 ## 10 000 Punks - The Free Do-It-Yourself (DIY) White Label Quick Starter Edition > Q: Dear sir, how do I get rich in ~bits-coin~ punks? > > A: If we all buy ~bits-coin~ punks from one another > at ever higher prices we'll all be rich beyond our wildest dreams. > > 21 million bits-coin. 10 000 punks. Do the math. Let's (re)create from zero / scratch a pixel-perfect copy of the Matt & John's 10 000 punks collection (Anno 2017). Yes, you can. Do-it-yourself (DIY) and own 100% forever your home-made free clean-room copy of the billion dollar (2400×2400) bitmap that kicked-off a trillion dollar get-rich-quick digital art mania / bubble in 2021 - selling "decentralized" ~blockchain tokens~ database records to ever greater fools at ever higher prices. ### Inside the Magic Money Machine - Mint 10 000 Unique Punks from 11 Archtetypes 'n' 122 Attributes Let's copy and (re)use all punk (building) blocks in the basic series (24×24): 11 Archetypes: Male 1/2/3/4 ![](basic/male1.png) ![](basic/male2.png) ![](basic/male3.png) ![](basic/male4.png), Female 1/2/3/4 ![](basic/female1.png) ![](basic/female2.png) ![](basic/female3.png) ![](basic/female4.png), Zombie ![](basic/zombie.png), Ape ![](basic/ape.png), Alien ![](basic/alien.png) 122 Attributes (by category and a-z): - Hat - Bandana (m/f) ![](basic/m/bandana.png) ![](basic/f/bandana.png), Beanie (m) ![](basic/m/beanie.png), Cap (m/f) ![](basic/m/cap.png) ![](basic/f/cap.png), Cap Forward (m) ![](basic/m/capforward.png), Cowboy Hat (m) ![](basic/m/cowboyhat.png), Do-rag (m) ![](basic/m/dorag.png), Fedora (m) ![](basic/m/fedora.png), Headband (m/f) ![](basic/m/headband.png) ![](basic/f/headband.png), Hoodie (m) ![](basic/m/hoodie.png), Knitted Cap (m/f) ![](basic/m/knittedcap.png) ![](basic/f/knittedcap.png), Pilot Helmet (f) ![](basic/f/pilothelmet.png), Police Cap (m) ![](basic/m/policecap.png), Tassle Hat (f) ![](basic/f/tasslehat.png), Tiara (f) ![](basic/f/tiara.png), Top Hat (m) ![](basic/m/tophat.png) - Hair - Blonde Bob (f) ![](basic/f/blondebob.png), Blonde Short (f) ![](basic/f/blondeshort.png), Clown Hair Green (m/f) ![](basic/m/clownhairgreen.png) ![](basic/f/clownhairgreen.png), Crazy Hair (m/f) ![](basic/m/crazyhair.png) ![](basic/f/crazyhair.png), Dark Hair (f) ![](basic/f/darkhair.png), Frumpy Hair (m/f) ![](basic/m/frumpyhair.png) ![](basic/f/frumpyhair.png), Half Shaved (f) ![](basic/f/halfshaved.png), Messy Hair (m/f) ![](basic/m/messyhair.png) ![](basic/f/messyhair.png), Mohawk (m/f) ![](basic/m/mohawk.png) ![](basic/f/mohawk.png), Mohawk Dark (m/f) ![](basic/m/mohawkdark.png) ![](basic/f/mohawkdark.png), Mohawk Thin (m/f) ![](basic/m/mohawkthin.png) ![](basic/f/mohawkthin.png), Orange Side (f) ![](basic/f/orangeside.png), Peak Spike (m) ![](basic/m/peakspike.png), Pigtails (f) ![](basic/f/pigtails.png), Pink With Hat (f) ![](basic/f/pinkwithhat.png), Purple Hair (m) ![](basic/m/purplehair.png), Red Mohawk (f) ![](basic/f/redmohawk.png), Shaved Head (m) ![](basic/m/shavedhead.png), Straight Hair (f) ![](basic/f/straighthair.png), Straight Hair Blonde (f) ![](basic/f/straighthairblonde.png), Straight Hair Dark (f) ![](basic/f/straighthairdark.png), Stringy Hair (m/f) ![](basic/m/stringyhair.png) ![](basic/f/stringyhair.png), Vampire Hair (m) ![](basic/m/vampirehair.png), Wild Blonde (f) ![](basic/f/wildblonde.png), Wild Hair (m/f) ![](basic/m/wildhair.png) ![](basic/f/wildhair.png), Wild White Hair (f) ![](basic/f/wildwhitehair.png) - Eyes - 3D Glasses (m/f) ![](basic/m/3dglasses.png) ![](basic/f/3dglasses.png), Big Shades (m/f) ![](basic/m/bigshades.png) ![](basic/f/bigshades.png), Classic Shades (m/f) ![](basic/m/classicshades.png) ![](basic/f/classicshades.png), Eye Mask (m/f) ![](basic/m/eyemask.png) ![](basic/f/eyemask.png), Eye Patch (m/f) ![](basic/m/eyepatch.png) ![](basic/f/eyepatch.png), Horned Rim Glasses (m/f) ![](basic/m/hornedrimglasses.png) ![](basic/f/hornedrimglasses.png), Nerd Glasses (m/f) ![](basic/m/nerdglasses.png) ![](basic/f/nerdglasses.png), Regular Shades (m/f) ![](basic/m/regularshades.png) ![](basic/f/regularshades.png), Small Shades (m) ![](basic/m/smallshades.png), VR (m/f) ![](basic/m/vr.png) ![](basic/f/vr.png), Welding Goggles (f) ![](basic/f/weldinggoggles.png) - Eyes (Makeup) - Blue Eye Shadow (f) ![](basic/f/blueeyeshadow.png), Clown Eyes Blue (m/f) ![](basic/m/clowneyesblue.png) ![](basic/f/clowneyesblue.png), Clown Eyes Green (m/f) ![](basic/m/clowneyesgreen.png) ![](basic/f/clowneyesgreen.png), Green Eye Shadow (f) ![](basic/f/greeneyeshadow.png), Purple Eye Shadow (f) ![](basic/f/purpleeyeshadow.png) - Blemishes - Mole (m/f) ![](basic/m/mole.png) ![](basic/f/mole.png), Rosy Cheeks (m/f) ![](basic/m/rosycheeks.png) ![](basic/f/rosycheeks.png), Spots (m/f) ![](basic/m/spots.png) ![](basic/f/spots.png) - Nose - Clown Nose (m/f) ![](basic/m/clownnose.png) ![](basic/f/clownnose.png), - Ears - Earring (m/f) ![](basic/m/earring.png) ![](basic/f/earring.png) - Mouth - Buck Teeth (m) ![](basic/m/buckteeth.png), Frown (m) ![](basic/m/frown.png), Smile (m) ![](basic/m/smile.png) - Mouth (Makeup) - Black Lipstick (f) ![](basic/f/blacklipstick.png), Hot Lipstick (f) ![](basic/f/hotlipstick.png), Purple Lipstick (f) ![](basic/f/purplelipstick.png) - Mouth Prop - Cigarette (m/f) ![](basic/m/cigarette.png) ![](basic/f/cigarette.png), Medical Mask (m/f) ![](basic/m/medicalmask.png) ![](basic/f/medicalmask.png), Pipe (m/f) ![](basic/m/pipe.png) ![](basic/f/pipe.png), Vape (m/f) ![](basic/m/vape.png) ![](basic/f/vape.png) - Beard - Big Beard (m) ![](basic/m/bigbeard.png), Chinstrap (m) ![](basic/m/chinstrap.png), Front Beard (m) ![](basic/m/frontbeard.png), Front Beard Dark (m) ![](basic/m/frontbearddark.png), Goat (m) ![](basic/m/goat.png), Handlebars (m) ![](basic/m/handlebars.png), Luxurious Beard (m) ![](basic/m/luxuriousbeard.png), Mustache (m) ![](basic/m/mustache.png), Muttonchops (m) ![](basic/m/muttonchops.png), Normal Beard (m) ![](basic/m/normalbeard.png), Normal Beard Black (m) ![](basic/m/normalbeardblack.png), Shadow Beard (m) ![](basic/m/shadowbeard.png) - Neck Accessory - Choker (f) ![](basic/f/choker.png), Gold Chain (m/f) ![](basic/m/goldchain.png) ![](basic/f/goldchain.png), Silver Chain (m/f) ![](basic/m/silverchain.png) ![](basic/f/silverchain.png) (Source: [Punk (Building) Blocks - Basic Series (24×24)](https://github.com/cryptopunksnotdead/punks.blocks#basic-punk-series-2424)) Let's wipe up a `generatePunk` function that pastes / composes together the building blocks / attributes and returns a ready-to-save image. Example: ``` go // generate punk #0 punk = generatePunk( "Female 2", "Earring", "Blonde Bob", "Green Eye Shadow" ) punk.Save( "./punk0.png" ) punk.Zoom(20).Save( "./punk0@20x.png" ) // generate punk #1 punk = generatePunk( "Male 1", "Smile", "Mohawk" ) punk.Save( "./punk1.png" ) punk.Zoom(20).Save( "./punk1@20x.png" ) ``` Here we go - the billion dollar formula: ``` go package main import ( "fmt" "strings" "regexp" "github.com/learnpixelart/pixelart.go/pixelart" ) // allow (ignore): // space ( ), // underscore (_), // dash (-) var normalizeRegexp = regexp.MustCompile( "[ _-]" ) func normalize( str string ) string { str = strings.ToLower( str ) str = normalizeRegexp.ReplaceAllString( str, "" ) return str } var dir = "../basic" func generatePunk( values ...string ) *pixelart.Image { punkType := values[0] attributeNames := values[1:len(values)] punkType = normalize( punkType ) path := dir + "/" + punkType + ".png" punk := pixelart.ReadImage( path ) var m_or_f string if strings.Index( punkType, "female" ) != -1 { m_or_f = "f" } else { m_or_f = "m" } for _, attributeName := range attributeNames { if attributeName == "" { // skip empty attributes continue } attributeName = normalize( attributeName ) path = dir + "/" + m_or_f + "/" + attributeName + ".png" attribute := pixelart.ReadImage( path ) punk.Paste( attribute ) } return punk } ``` Let's test drive punk #0 and punk 1 ``` go func main() { fmt.Printf( "Hello, Pixel Art v%s!\n", pixelart.Version ) // test drive // generate punk #0 punk := generatePunk( "Female 2", "Earring", "Blonde Bob", "Green Eye Shadow" ) punk.Save( "punk0.png" ) punk.Zoom(20).Save( "punk0@20x.png" ) // generate punk #1 punk = generatePunk( "Male 1", "Smile", "Mohawk" ) punk.Save( "punk1.png" ) punk.Zoom(20).Save( "punk1@20x.png" ) } ``` and voila! In the original 24×24 format: ![](i/punk0.png) ![](i/punk1.png) And 20x (480×480): ![](i/punk0@20x.png) ![](i/punk1@20x.png) Note: If you use your own building blocks make sure your type and attribute names match the filenames (without the `.png` extension). For the matching algorithm all names get automatically downcased and all spaces deleted, thus, `Male 1` will map to `male1.png` ![](basic/male1.png) and `3D Glasses` to `3dglasses.png` ![](basic/m/3dglasses.png) and `Knitted Cap` to `knittedcap.png` ![](basic/m/knittedcap.png) and so on. Let's read-in all meta data records for all 10 000 punks. See the [punks.csv](punks.csv) dataset that reads: ``` type, attribute1, attribute2, attribute3, attribute4, attribute5, attribute6, attribute7 Female 2, Earring, Blonde Bob, Green Eye Shadow,,,, Male 1, Smile, Mohawk,,,,, Female 3, Wild Hair,,,,,, Male 1, Wild Hair, Pipe, Nerd Glasses,,,, Male 2, Goat, Earring, Wild Hair, Big Shades,,, Female 2, Earring, Half Shaved, Purple Eye Shadow,,,, Male 2, Do-rag,,,,,, Female 2, Spots, Wild White Hair, Clown Eyes Blue,,,, Male 1, Luxurious Beard, Messy Hair,,,,, Male 2, Big Beard, ... ...

近期下载者

相关文件


收藏者