Recent Releases of inferencevision
inferencevision - v1.2
Migration from Version 1.1 to 1.2
Version: 1.2
Summary of Changes:
1. Added Precision Configuration:
- Introduced the
coord_precisionparameter in the__init__method, allowing configuration of the number of decimal places for geographic coordinates. The default is 9 decimal places.
2. Error Handling:
- Added error handling for opening the TIFF file with a
try-exceptblock to raise aValueErrorif the file cannot be opened. - Added error handling for model inference with a
try-exceptblock to raise aRuntimeErrorif the model prediction fails or any other exception occurs during processing.
3. Enhanced Geographic Coordinates Formatting:
- Geographic coordinates are now formatted according to the
coord_precisionparameter, providing more control over output precision.
4. Improved Output Information:
- Updated the CSV column name from "Probability" to "Confidence Score".
- Updated print statements to use a consistent format for confidence scores and bounding box centers, including improved formatting for bounding box center coordinates.
5. Code Cleanup and Documentation:
- Improved code comments and docstrings for clarity and consistency.
- Added example usage for the new
coord_precisionparameter in documentation.
Detailed Changes:
Constructor (
__init__method):- Added
coord_precisionparameter:python def __init__(self, tif_path, model_path, coord_precision=9): - Added error handling for TIFF file opening:
python try: with rasterio.open(self.tif_path) as dataset: self.image_width = dataset.width self.image_height = dataset.height except rasterio.errors.RasterioIOError as e: raise ValueError(f"Error opening TIFF file {self.tif_path}: {e}")
- Added
Process Image Method:
- Added error handling for model loading and inference:
python try: model = YOLO(self.model_path) results = model.predict(self.tif_path) except Exception as e: raise RuntimeError(f"Error during model inference: {e}") - Updated geographic coordinates formatting to use
coord_precision:python formatted_geographic_coords = np.array([ [f'{lat:.{self.coord_precision}f}', f'{lon:.{self.coord_precision}f}'] for lat, lon in geographic_coords ]) - Updated CSV column name and print statements:
python "Confidence Score": box.conf[0].item() - Added error handling for image processing:
python except Exception as e: raise RuntimeError(f"Error processing the image: {e}")
- Added error handling for model loading and inference:
- Jupyter Notebook
Published by doguilmak almost 2 years ago
inferencevision - v1.1
Release Notes
Changelog
1. Image Dimensions Handling
- New Feature: Automatic extraction of image dimensions (
image_width,image_height) from the TIFF file during initialization.- Benefit: This removes the need to manually specify the image dimensions when creating an
InferenceVisioninstance.
- Benefit: This removes the need to manually specify the image dimensions when creating an
2. Improved Documentation
- Enhancement: Added detailed docstrings to all class methods, improving clarity and usability.
- Benefit: Users can now better understand each method’s purpose, input parameters, and expected outputs, making the class easier to use and integrate.
Migration Guide from v1.0 to v1.1
To upgrade from InferenceVision v1.0 to v1.1, follow these simple steps:
1. Initialization Changes
- v1.0: When creating an
InferenceVisioninstance, you had to provide the image dimensions (image_widthandimage_height) manually. - v1.1: Image dimensions are automatically extracted from the TIFF file, so you no longer need to pass
image_widthandimage_height.
Example Migration: ```python
v1.0 Initialization
inference = InferenceVision(tifpath="path/to/image.tif", modelpath="path/to/model.pt", imagewidth=1024, imageheight=768)
v1.1 Initialization (no need for image dimensions)
inference = InferenceVision(tifpath="path/to/image.tif", modelpath="path/to/model.pt")
- Jupyter Notebook
Published by doguilmak almost 2 years ago
inferencevision - InferenceVision v1.0
We are excited to announce the release of InferenceVision version 1.0! This release represents a significant advancement in geospatial analysis, offering powerful capabilities for object detection and geographic coordinate calculation.
In version 1.0, it is enabling automated identification and localization of objects within satellite or aerial imagery for YOLO models trained via Ultralytics. Additionally, our robust algorithms accurately calculate geographic coordinates (latitude and longitude) for detected objects relative to a given bounding polygon, facilitating precise geospatial analysis.
With InferenceVision version 1.0, users can streamline their geospatial workflows, reduce manual effort, and achieve higher accuracy and efficiency in identifying and locating objects within geographic areas.
Key features of this release include: - Object detection using YOLO algorithm - Calculation of geographic coordinates for detected objects - Integration with geographic information systems (GIS) for visualization and analysis
We believe that InferenceVision version 1.0 will empower users to tackle complex geospatial challenges effectively. We encourage you to explore the capabilities of this release and provide feedback to help us improve and enhance future versions.
- Jupyter Notebook
Published by doguilmak about 2 years ago