How to make 3D models from text using AI for 3D printing

Поделиться
HTML-код
  • Опубликовано: 10 июн 2023
  • Accelerate your 3D printing journey: www.kickstarter.com/projects/...
    Newly released code allows you to create actual 3D models directly from text and you can 3D print them!
    SHAP-E CODE:
    __________
    Code snippet #1
    !git clone github.com/openai/shap-e.git
    __________
    Code snippet #2
    %cd shap-e
    __________
    Code snippet #3
    !pip install -e .
    __________
    Code snippet #4
    import torch
    from shap_e.diffusion.sample import sample_latents
    from shap_e.diffusion.gaussian_diffusion import diffusion_from_config
    from shap_e.models.download import load_model, load_config
    from shap_e.util.notebooks import create_pan_cameras, decode_latent_images, gif_widget
    __________
    Code snippet #5
    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
    __________
    Code snippet #6
    xm = load_model('transmitter', device=device)
    model = load_model('text300M', device=device)
    diffusion = diffusion_from_config(load_config('diffusion'))
    __________
    Code snippet #7
    batch_size = 4
    guidance_scale = 15.0
    prompt = "shark"
    latents = sample_latents(
    batch_size=batch_size,
    model=model,
    diffusion=diffusion,
    guidance_scale=guidance_scale,
    model_kwargs=dict(texts=[prompt] * batch_size),
    progress=True,
    clip_denoised=True,
    use_fp16=True,
    use_karras=True,
    karras_steps=64,
    sigma_min=1e-3,
    sigma_max=160,
    s_churn=0,
    )
    __________
    Code snippet #8
    render_mode = 'nerf' # you can change this to 'stf'
    size = 128 # this is the size of the renders; higher values take longer to render.
    cameras = create_pan_cameras(size, device)
    for i, latent in enumerate(latents):
    images = decode_latent_images(xm, latent, cameras, rendering_mode=render_mode)
    display(gif_widget(images))
    __________
    Code snippet #9
    Example of saving the latents as meshes.
    from shap_e.util.notebooks import decode_latent_mesh
    for i, latent in enumerate(latents):
    t = decode_latent_mesh(xm, latent).tri_mesh()
    with open(f'shark_mesh_{i}.ply', 'wb') as f:
    t.write_ply(f)
    with open(f'shark_mesh_{i}.obj', 'w') as f:
    t.write_obj(f)

Комментарии • 34

  • @xacbolay
    @xacbolay 11 месяцев назад +1

    This is amizing! thanks for helping the newbies like me start in this the easiest way!

  • @aegisgfx
    @aegisgfx Год назад +5

    Works good. This is the beginning of the 3d AI era, a year from now it might be all over for people who cant use AI to make art or 3D

    • @robertproudfoot7990
      @robertproudfoot7990 Год назад +3

      very unlikely its inside a year. Classic first failings of all humans (myself included) is to see something cool and vastly underestimate the timeframe its going to take. A point a colleague made today. How many people use voice for text? you wrote this with a keyboard, yet voice to text has existed for like 2 decades. Where's VR? Then ask yourself, whats the realistic timescale that AI is generating models (in a way that actually competes vs a skilled competent person). Its going to be quite some time before an AI can beat a skilled persons when doing complex modelling that requires things like stress analysis. Sure gimmicky shit, AI got that down.

    • @aegisgfx
      @aegisgfx Год назад +2

      @@robertproudfoot7990 stable diffusion went from crap to perfection in 6 months, I think you underestimate how fast this is all moving

    • @leo-js6nk
      @leo-js6nk Год назад +1

      Anyone can use AI to make art or 3D (or anything). That is the point of those AI tools. The barrier to entry is close to 0. As long as those AI remain tools in the sense that they do not act as AGI, they will need human imput. It will thus be like photography. The barrier to taking a photo is having a camera or a cellphone. But not anyone can be a good/great photographer; that requires skills other than simply being able to manipulate a camera. In the same vein (and as long as we don't have AGI) those who currently are good artists will be able to make use of AI to create things that people with no artistic skills could not. And when we have AGI well... that's a wrap on pretty much everything.

    • @NickyPerry-zy6xw
      @NickyPerry-zy6xw Год назад

      @@aegisgfx I used this all day yesterday and I wish it was ready but its not. Will need another 6 months or so. But these models are unusable lmao

    • @aegisgfx
      @aegisgfx Год назад

      @@NickyPerry-zy6xw well it depends, if you get a low res shark out of it then you can take that into sculpt mode, up the res and sculpt in the details. So its working we for creating base models at the moment in my opinion

  • @TriQuad
    @TriQuad Год назад +2

    This is insane, thanks for rhe tut, if u have any more tips or tricks to use with this AI pls do more vids of dem

  • @sameeruddin
    @sameeruddin Год назад

    This was really helpful ..thank you so much !

  • @NickyPerry-zy6xw
    @NickyPerry-zy6xw Год назад

    Thank you!

  • @mikejones-vd3fg
    @mikejones-vd3fg Год назад +2

    very cool

  • @aeQuator
    @aeQuator 11 месяцев назад

    to bad this is not shoing in youtube search what so ever...This is exacly what i was looking for...Took mee weeks to find this where you not need any whitelist or buying some wrong ai acces...
    very big thanks from my side!

  • @lineobiribin1157
    @lineobiribin1157 7 месяцев назад +1

    I noticed that the repository does not specify a license. Could you please clarify if the code is open for public use, and if so, if there are any specific terms or conditions I should be aware of? I want to ensure that I respect the original author's intentions and comply with any applicable licensing terms.

  • @DeepFrydTurd
    @DeepFrydTurd 8 месяцев назад

    import it into Z brush and refine it and add textures lol, Fast workflow dude

  • @asocialconsciousness8535
    @asocialconsciousness8535 Год назад

    Can this be run inside of jyputer notebook locally? But yes mike is right! this is very cool!!

  • @b1O15
    @b1O15 Год назад +1

    code snippet 6 isnt working for me, it says it should have hash (bunch of letters and numbers) but has (different letters and numbers) try deleting and running this call again. i keep trying that but isnt working.
    i have like 0 coding knowledge so yaaa..

  • @A.ECompetency-hq4nn
    @A.ECompetency-hq4nn 7 месяцев назад

    How to integrate this in android studio for app

  • @ArisenProdigy
    @ArisenProdigy Год назад +7

    Why not just make a colab notebook with all the stuff in it and share the ipynb?

    • @aegisgfx
      @aegisgfx Год назад +2

      ya I wondered that too

  • @jamespfrommer5048
    @jamespfrommer5048 6 месяцев назад

    can frosting ai work?

  • @jefflane2012
    @jefflane2012 Год назад

    I received "SHA256 checksum does not match" on #7 text300M load_model

    • @jefflane2012
      @jefflane2012 Год назад +1

      I ran the code again and it worked. It said it re-downloaded the file.

  • @ayazbulat
    @ayazbulat 8 месяцев назад +1

    Please help!!!!!!!!!!
    batch_size = 4
    guidance_scale = 15.0
    prompt = "shark"
    -> latents = sample_latents(
    batch_size=batch_size,
    model=model,
    diffusion=diffusion,
    guidance_scale=guidance_scale,
    model_kwargs=dict(texts=[prompt] * batch_size),
    progress=True,
    clip_denoised=True,
    use_fp16=True,
    use_karras=True,
    karras_steps=64,
    sigma_min=1e-3,
    sigma_max=160,
    s_churn=0,
    )
    "NameError: name 'latents' is not defined". Please help!!!!

  • @edwardkay
    @edwardkay Год назад

    when I try this it is saying error for this line: latents = sample_latents( any ideas how to fix this?

    • @3DPrinterAcademy
      @3DPrinterAcademy Год назад +2

      Did you change the notebook settings to "GPU"? 0:14
      Make sure you do that before everything else

    • @edwardkay
      @edwardkay Год назад

      @@3DPrinterAcademy Yeah, I followed all the steps exactly. It's very odd

    • @3DPrinterAcademyTutorials
      @3DPrinterAcademyTutorials  Год назад +2

      you can also use GPT4 to help debug coding errors. Just ask the AI, "what does this error message mean: (past error message)"
      It can be very helpful!

    • @edwardkay
      @edwardkay Год назад

      @@3DPrinterAcademyTutorials ah yeah, good point. thanks :)

    • @lmarsh5407
      @lmarsh5407 11 месяцев назад

      how did you fix this? I'm getting the same error

  • @dominik1023
    @dominik1023 9 месяцев назад

    What code snippet???????????????????????

    • @eier81
      @eier81 9 месяцев назад

      Check the description of the video.

  • @Zontar82
    @Zontar82 4 месяца назад

    God forbid having it in a proper, easy ti use GUI aint'it ? elitist gonna be eliti-ing?

  • @roccoforte6011
    @roccoforte6011 11 месяцев назад

    Hello Thanks for this content!! So everything was fine i changes the prompt to "sunglasses" and it made them but the last part to save them for download and after this final snippet "# Example of saving the latents as meshes.
    from shap_e.util.notebooks import decode_latent_mesh
    for i, latent in enumerate(latents):
    t = decode_latent_mesh(xm, latent).tri_mesh()
    with open(f'sunglasses_mesh_{i}.ply', 'wb') as f:
    t.write_ply(f)
    with open(f'sunglasses_mesh_{i}.obj', 'w') as f:
    t.write_obj(f)" Nothing happens it just completes the run in 4 seconds