GithubHelp home page GithubHelp logo

I have downloaded kitti dataset the labels are both in string and float format I cannot covert into float as it has 7000 images and labels about ultralytics HOT 3 OPEN

Jananiyar avatar Jananiyar commented on July 19, 2024
I have downloaded kitti dataset the labels are both in string and float format I cannot covert into float as it has 7000 images and labels

from ultralytics.

Comments (3)

github-actions avatar github-actions commented on July 19, 2024

👋 Hello @Jananiyar, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on July 19, 2024

@Jananiyar hi there!

Thank you for reaching out. It looks like you're facing an issue with mixed data types in your KITTI dataset labels. To help you efficiently convert all labels to a consistent format, you can use a script to automate this process. Below is a Python example that reads the label files, converts the necessary fields to float, and saves them back:

import os

def convert_labels_to_float(label_dir):
    for label_file in os.listdir(label_dir):
        if label_file.endswith('.txt'):
            file_path = os.path.join(label_dir, label_file)
            with open(file_path, 'r') as file:
                lines = file.readlines()
            
            with open(file_path, 'w') as file:
                for line in lines:
                    parts = line.split()
                    # Assuming the coordinates are in columns 4 to 7
                    parts[4:8] = map(float, parts[4:8])
                    file.write(' '.join(map(str, parts)) + '\n')

label_directory = 'path/to/your/label/directory'
convert_labels_to_float(label_directory)

This script will iterate over all .txt files in your specified label directory, convert the relevant parts to float, and save the changes.

Before running this script, please ensure you have the latest versions of torch and ultralytics installed. You can update them using:

pip install --upgrade torch ultralytics

If you encounter any issues or need further assistance, please provide a minimum reproducible code example as outlined in our documentation. This will help us better understand and address your problem.

Happy coding! 😊

from ultralytics.

github-actions avatar github-actions commented on July 19, 2024

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

from ultralytics.

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.