point-e icon indicating copy to clipboard operation
point-e copied to clipboard

pip installing point-e / importing point-e

Open brinpat opened this issue 3 years ago • 6 comments

Not too sure how to pip install point-e. I saw pip install -e, but believe that is an editable install for the setup.py

brinpat avatar Dec 21 '22 19:12 brinpat

Try: !pip install git+https://github.com/openai/point-e.git works for my colab

pratos avatar Dec 21 '22 19:12 pratos

Hey thanks managed to install that but I now receive the following error: ModuleNotFoundError: No module named 'point_e'.

I tried import point_e and import point-e

brinpat avatar Dec 21 '22 20:12 brinpat

Hello @brinpat, your problem can be solved by changing the direction after installing the repository.

As @pratos recommended you: 1st: !pip install git+https://github.com/openai/point-e.git

Then: 2nd: %cd point-e 3rd: !pip install .

Hope this hill help you :)

pedromartip avatar Dec 22 '22 10:12 pedromartip

Perhaps it should be blatantly obvious, but it is not clear to me what to do after pip install . successfully completed?

master0v avatar Dec 25 '22 16:12 master0v

Perhaps it should be blatantly obvious, but it is not clear to me what to do after pip install . successfully completed?

Same issue, what do i do after doing pip install . , do run the application on cmd or is there a way to download it?. Sorry, I am a beginner in this issue.

jackjack21-pixel avatar Dec 25 '22 23:12 jackjack21-pixel

Hi guys, sorry for the delayed answer.

After doing that I did. You only need to run the code as the author @unixpickle wrote it, you can follow this example: https://github.com/openai/point-e/blob/main/point_e/examples/image2pointcloud.ipynb

In order to make it easier to you, here you have the complete code. Only paste and copy! :)

1. Package instalation

!git clone https://github.com/openai/point-e.git
%cd point-e
!pip install .

2. Package import

from PIL import Image
import torch
from tqdm.auto import tqdm

from point_e.diffusion.configs import DIFFUSION_CONFIGS, diffusion_from_config
from point_e.diffusion.sampler import PointCloudSampler
from point_e.models.download import load_checkpoint
from point_e.models.configs import MODEL_CONFIGS, model_from_config
from point_e.util.plotting import plot_point_cloud


3. Model prep

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

print('creating base model...')
base_name = 'base1B' # Qualitat resultat = base40M < base300M < base1B (de pitjor a millor)
base_model =  model_from_config(MODEL_CONFIGS[base_name], device)
base_model.eval()
base_diffusion = diffusion_from_config(DIFFUSION_CONFIGS[base_name])

print('creating upsample model...')
upsampler_model = model_from_config(MODEL_CONFIGS['upsample'], device)
upsampler_model.eval()
upsampler_diffusion = diffusion_from_config(DIFFUSION_CONFIGS['upsample'])

print('downloading base checkpoint...')
base_model.load_state_dict(load_checkpoint(base_name, device))

print('downloading upsampler checkpoint...')
upsampler_model.load_state_dict(load_checkpoint('upsample', device))

4.  Sampler prep

sampler = PointCloudSampler(
    device=device,
    models=[base_model, upsampler_model],
    diffusions=[base_diffusion, upsampler_diffusion],
    num_points=[1024, 4096 - 1024],
    aux_channels=['R', 'G', 'B'],
    guidance_scale=[3.0, 3.0],
)

4. Execution of interfaces


img = Image.open('point_e/examples/example_data/cube_stack.jpg')
samples = None
for x in tqdm(sampler.sample_batch_progressive(batch_size=1, model_kwargs=dict(images=[img]))):
    samples = x

5. Display of 3D point cloud

pc = sampler.output_to_point_clouds(samples)[0]
fig = plot_point_cloud(pc, grid_size=3, fixed_bounds=((-0.75, -0.75, -0.75),(0.75, 0.75, 0.75)))

pedromartip avatar Dec 27 '22 10:12 pedromartip

I am having trouble with this download. I am on the last portion and the input on #3 Model Prep

This :

print('downloading base checkpoint...') base_model.load_state_dict(load_checkpoint(base_name, device))

Is not working for me as it says

NameError Traceback (most recent call last) in 13 14 print('downloading base checkpoint...') ---> 15 base_model.load_state_dict(load_checkpoint(base_name, device)) 16 17 print('downloading upsampler checkpoint...')

NameError: name 'load_checkpoint' is not defined

HOW DO I GET PAST THIS - its 2023 February can we still access this text to 2d model

Chantelley avatar Feb 11 '23 18:02 Chantelley

@Chantelley, looks like that function was imported in the second step detailed by @pedromartip, namely:

from point_e.models.download import load_checkpoint

You'll need to import all functions you plan on using before they'll be accessible.

cjgibson avatar Feb 11 '23 21:02 cjgibson

Just made my first 3D generated model of a red bike! Thanks ;)

brinpat avatar Feb 11 '23 22:02 brinpat