Comments (7)
π Hello @AlessandroB1298, 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):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
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.
Hello!
Currently, TensorFlow.js does not natively support oriented bounding boxes (OBB) directly as part of its model operations. However, you can still use YOLOv8 models that output OBB by handling the orientation aspect in your post-processing logic after running the inference in TensorFlow.js.
You would need to export your YOLOv8 model to the TensorFlow.js format and then implement the logic to interpret the orientation data from the model's output in your application. This approach requires custom handling of the output tensors to manage the orientation.
For exporting YOLOv8 models to TensorFlow.js, you can follow the standard export procedure using the model.export(format='tfjs')
method in Python.
If you need further guidance on handling the post-processing or any other specifics, feel free to ask!
from ultralytics.
from ultralytics.
Hello!
I'm glad to assist with the post-processing for OBB in TensorFlow.js! When you receive the output x, y, w, h, r
from your model:
x
andy
are the center coordinates of the bounding box.w
andh
are the width and height of the box.r
represents the rotation of the box in radians.
To translate these into a usable format in TensorFlow.js, you can create a function to calculate the corners of the rotated rectangle based on these parameters. Here's a basic example of how you might implement this:
function calculateCorners(x, y, w, h, r) {
const angle = -r; // Adjust rotation direction if necessary
const corners = [];
const dx = [1, 1, -1, -1];
const dy = [1, -1, -1, 1];
for (let i = 0; i < 4; i++) {
const cx = w * dx[i] / 2;
const cy = h * dy[i] / 2;
const cosA = Math.cos(angle);
const sinA = Math.sin(angle);
const nx = cx * cosA - cy * sinA;
const ny = cx * sinA + cy * cosA;
corners.push([x + nx, y + ny]);
}
return corners;
}
This function calculates the corners of the box which you can then use to draw or further process in your application. If you have any more questions or need further clarification, feel free to reach out! π
from ultralytics.
from ultralytics.
Hello!
I'm glad to hear that the previous information was helpful! Let's dive into your new question regarding processing the data with onnxruntime-web
.
When you run inference and get 457 boxes, it means the model has detected multiple objects. The raw output from the model typically includes bounding box coordinates, confidence scores, and class probabilities. You'll need to parse this output to extract meaningful information.
Here's a step-by-step guide to process the output:
-
Extract Bounding Boxes, Scores, and Classes:
The output array contains the bounding box coordinates, confidence scores, and class probabilities. You need to reshape and interpret this data correctly. -
Filter by Confidence Score:
To reduce the number of boxes, filter out those with low confidence scores. -
Non-Maximum Suppression (NMS):
Apply NMS to eliminate redundant boxes that overlap significantly.
Here's an example of how you might implement this in JavaScript:
// Function to process the model output
const processOutput = (output, confidenceThreshold = 0.5, iouThreshold = 0.5) => {
const boxes = [];
const scores = [];
const classes = [];
// Assuming output is a flat array, reshape and extract data
for (let i = 0; i < output.length; i += 6) {
const score = output[i + 4];
if (score > confidenceThreshold) {
const x = output[i];
const y = output[i + 1];
const w = output[i + 2];
const h = output[i + 3];
const classId = output[i + 5];
boxes.push([x, y, w, h]);
scores.push(score);
classes.push(classId);
}
}
// Apply Non-Maximum Suppression (NMS)
const nmsIndices = applyNMS(boxes, scores, iouThreshold);
const finalBoxes = nmsIndices.map(index => boxes[index]);
const finalScores = nmsIndices.map(index => scores[index]);
const finalClasses = nmsIndices.map(index => classes[index]);
return { boxes: finalBoxes, scores: finalScores, classes: finalClasses };
};
// Function to apply Non-Maximum Suppression (NMS)
const applyNMS = (boxes, scores, iouThreshold) => {
// Implement NMS logic here
// This is a placeholder for the actual NMS implementation
return []; // Return indices of the boxes to keep
};
// Example usage
const runModel = async (input) => {
input = new ort.Tensor(Float32Array.from(input), [1, 3, 640, 640]);
const outputs = await model.run({ images: input });
const rawOutput = outputs["output0"].data;
const processedOutput = processOutput(rawOutput);
console.log(processedOutput);
return processedOutput;
};
In this example:
processOutput
function filters boxes based on a confidence threshold and applies NMS.applyNMS
is a placeholder for the actual NMS implementation. You can use libraries liketf.image.nonMaxSuppression
in TensorFlow.js or implement your own NMS logic.
Feel free to adjust the confidence and IoU thresholds as needed. If you have any more questions or need further assistance, don't hesitate to reach out! π
from ultralytics.
π 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:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
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)
- Using ultralytcis models to find very small edges HOT 2
- Regarding the Problem of Rectangle Rotation HOT 6
- The bounding box remains HOT 6
- What is the minimum number of image data and metadata to use the yolov8 model? HOT 2
- How to improve the performance of custom trained YOLOv8-pose model with 100+ keypoints HOT 1
- Installing Ultralytics with system installed matplotlib - cannot import name 'rcParams' ifrom matplotlib,axes(in python_path.) HOT 1
- Clarification on GPL License Usage in Closed-Source Projects HOT 2
- Mixup augmentation cancels mosaic augmentation. HOT 4
- a question about trainer.py HOT 1
- About pretrained YOLO models HOT 3
- question about yolo-world default text features? HOT 9
- Custom Checkpoints not working with SAM HOT 8
- May I ask if the model can still eliminate NMS if I change the v10Detect detection head to another detection headοΌ HOT 2
- Running exe using Ultralytics YOLOv8 packaged with pyinstaller causing WMIC popup command prompts on Windows HOT 4
- VCE Exam Simulator 2.9.2 Crack Free Download For Windows 10 HOT 1
- Wondershare Filmora X 13.6.4 Crack Download For Windows 10
- Adobe Acrobat Pro DC 24.2.20991 Crack & Keygen 2024 [Latest]
- AnyDesk 8.0.11 Crack With License Key 100% Working Download
- Movavi Photo Editor 24.4.4 Crack With Keygen For PC Download
- Segment object has no attribute detect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.