Coder Social home page Coder Social logo

Comments (5)

jndmw-111 avatar jndmw-111 commented on June 9, 2024

Have you solved the problem of data set generation? Can I ask you for help

from pixel2mesh.

ShusenWang123456 avatar ShusenWang123456 commented on June 9, 2024

I have the same problem and want to generate.dat file for data set. Have you solved it? Can you share the solution?

from pixel2mesh.

Michael-H1302 avatar Michael-H1302 commented on June 9, 2024

Yes I think I solved it. I wrote myself a short python program that converts the .xyz files into .dat files. You will have to give the program the path to your .xyz file as a command line argument. The program itself uses pickle to convert the .xyz into a .dat file and will drop that .dat file into the same directory where your .xyz file is located.

import pickle
import numpy as np
import sys

def myFunc():
    content = []
    with open(sys.argv[1], 'r') as f:
        for line in f.readlines():
                content.append(line.split(' '))

    print(content[0][0])

    data = []
    for i in range(len(content)):
        data.append([])
        for k in range(len(content[i])):
            data[i].append(float(content[i][k]))

    output_path = sys.argv[1]
    output_path = output_path[:output_path.rfind('/') + 1] + output_path[output_path.rfind('/') + 1:output_path.rfind('.')]
    output_path = output_path + ".dat"
    print(output_path)
    with open(output_path, 'wb') as f:
        try:
            data = np.array(data)
            print(data.shape)
            pickle.dump(data, f, 2)
        except pickle.PicklingError:
            print('Error while reading from object. Object is not picklable')


myFunc()

from pixel2mesh.

WayneCV avatar WayneCV commented on June 9, 2024

Hi, I find the generate_dada.py also can sample the point from ground truth surface. Do you know the sampling operation difference between generate_dada.py and 1_sample_points.txt? I guess the sample in generate_dada.py is uniform. But if I want to generate the ground truth data in point form to compare with prediction, whether I just need to run the generate_dada.py? Or do I need to follow the step including 1_sample_points.txt, 2_generate_normal.py, 3_camera_transform.py?

from pixel2mesh.

Michaelwjh avatar Michaelwjh commented on June 9, 2024

Hi, I find the generate_dada.py also can sample the point from ground truth surface. Do you know the sampling operation difference between generate_dada.py and 1_sample_points.txt? I guess the sample in generate_dada.py is uniform. But if I want to generate the ground truth data in point form to compare with prediction, whether I just need to run the generate_dada.py? Or do I need to follow the step including 1_sample_points.txt, 2_generate_normal.py, 3_camera_transform.py?

Hi, have you known the sampling operation difference between generate_dada.py and (1_sample_points.txt, 2_generate_normal.py, 3_camera_transform.py?). They seem to achieve the same function

from pixel2mesh.

Related Issues (20)

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.