Giter Club home page Giter Club logo

Comments (3)

alexsax avatar alexsax commented on May 20, 2024 2

I generated the skip list using this file -- hope it helps!

import argparse
import os

import numpy as np
from tqdm import tqdm


def crawl_and_check_pose_files(root_dir, output_file=None):
    scenes = [
        d for d in os.listdir(root_dir) if os.path.isdir(os.path.join(root_dir, d))
    ]
    with open(output_file, "w") if output_file else None as f:
        for scene in tqdm(scenes, desc="Processing scenes"):
            scene_dir = os.path.join(root_dir, scene, "pose")
            if os.path.exists(scene_dir):
                for file in os.listdir(scene_dir):
                    if file.endswith(".txt"):
                        file_path = os.path.join(scene_dir, file)
                        try:
                            matrix = np.loadtxt(file_path)
                            if np.any(np.isinf(matrix)):
                                frame_id = file.replace(".txt", "")
                                output = f"{scene} {frame_id}\n"
                                if f:
                                    f.write(output)
                                else:
                                    print(output)
                        except Exception as e:
                            print(f"Error reading {file_path}: {e}")


def main():
    parser = argparse.ArgumentParser(
        description="Crawl directories for pose files, identify files with all -inf values, and save the results."
    )
    parser.add_argument(
        "path", type=str, help="The root directory to start crawling from."
    )
    parser.add_argument(
        "--output",
        "-o",
        type=str,
        default=None,
        help="File to save the output. Prints to stdout if not specified.",
    )

    args = parser.parse_args()
    crawl_and_check_pose_files(args.path, args.output)


if __name__ == "__main__":
    main()

from ponderv2.

HaoyiZhu avatar HaoyiZhu commented on May 20, 2024

Hi, thanks for your interest and your awesome code! Sorry for the late reply, I was on vacation last month :)Yeah we skip some broken data, and this is the skip.lst we use. I think your code can produce similar file with ours:)
skip.lst.txt

from ponderv2.

Related Issues (11)

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.