Skip to content

pip installing point-e / importing point-e #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brinpat opened this issue Dec 21, 2022 · 9 comments
Closed

pip installing point-e / importing point-e #16

brinpat opened this issue Dec 21, 2022 · 9 comments

Comments

@brinpat
Copy link

brinpat commented Dec 21, 2022

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

@pratos
Copy link

pratos commented Dec 21, 2022

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

@brinpat
Copy link
Author

brinpat commented Dec 21, 2022

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 brinpat changed the title pip installing point-e pip installing point-e / importing point-e Dec 22, 2022
@pedromartip
Copy link

pedromartip commented Dec 22, 2022

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 :)

@master0v
Copy link

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

@jackjack21-pixel
Copy link

jackjack21-pixel commented Dec 25, 2022

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.

@pedromartip
Copy link

pedromartip commented Dec 27, 2022

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)))

@Chantelley
Copy link

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

@cjgibson
Copy link

@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.

@brinpat
Copy link
Author

brinpat commented Feb 11, 2023

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

@brinpat brinpat closed this as completed Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants