satellite-image-classifier


Namesatellite-image-classifier JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/yourusername/satellite_image_classifier
SummaryA package for satellite image classification
upload_time2024-07-11 08:20:52
maintainerNone
docs_urlNone
authorYour Name
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Satellite Image Classification
![alt text](image1.png)
## Overview
This project provides a set of tools for classifying satellite images using various machine learning algorithms. The package supports supervised and unsupervised classification with Random Forest, Support Vector Machine (SVM), K-Nearest Neighbors (KNN), Logistic Regression, Maximum Likelihood, and Neural Networks. It also includes functionality for evaluating the classification model and using the trained model for inference on new images.
## Features
- Classification with various machine learning algorithms
- Customizable validation split
- Evaluation metrics (accuracy, kappa, F1 score) and confusion matrix visualization
- Model saving and loading for inference on new data
## Installation
To install the package, use pip:

```pip install satellite-image-classification```
## Usage
### Training
To perform classification on a satellite image, use the `classify` function. This function allows you to choose the algorithm and its parameters, as well as specify the validation split for training and evaluation.

Example

```python
from satellite_image_classification.classification import classify

# Paths to your input image, labeled shapefile, and output files
input_image = 'path/to/input_image.tif'
label_shapefile = 'path/to/polygons.shp'
output_image = 'path/to/output_image.tif'
model_output = 'path/to/model.pkl'
metrics_output = 'path/to/metrics.csv'
cm_output = 'path/to/confusion_matrix.png'

# Perform classification using Random Forest
classify(input_image, label_shapefile, output_image, algorithm='random_forest', val_split=0.3, model_output=model_output, metrics_output=metrics_output, cm_output=cm_output, n_estimators=100)
```

Supported Algorithms
- `random_forest`:  RandomForestClassifier (parameters: `n_estimators`)
- `svm`: SVC (parameters: `C`, `kernel`)
- `knn`: KNeighborsClassifier(parameters:`n_neighbors`)
- `maximum_likelihood`: GaussianNB

### Inference
To use a trained model for inference on a new satellite image, use the `inference` function.

Example

```python
from satellite_image_classification.classification import inference

# Paths to your input image, trained model, and output file
test_image = 'path/to/new_input_image.tif'
model_path = 'path/to/model.pkl'
output_image = 'path/to/output_image.tif'

# Perform inference using the trained model
inference(test_image, model_path, output_image)
```


# 衛星画像分類

## 概要
このプロジェクトは、さまざまな機械学習アルゴリズムを使用して衛星画像を分類するためのツールセットを提供します。ランダムフォレスト、サポートベクターマシン(SVM)、K最近傍法(KNN)、ロジスティック回帰、最尤法、ニューラルネットワークを使用した分類をサポートしています。また、分類モデルの評価や新しい画像への推論のための機能も含まれています。
## 特徴
- さまざまな機械学習アルゴリズムを使用した分類
- カスタマイズ可能な学習検証分割
- 評価指標(精度、kappa、F1スコア)および混同行列の可視化
- 新しいデータに対する推論
## インストール
パッケージをインストールするには、pipを使用します:

```pip install satellite-image-classification```

## 使用
衛星画像の分類を行うには、`classify`関数を使用します。この関数では、アルゴリズムとそのパラメータを選択し、トレーニングと評価のための検証分割を指定できます。
```python
from satellite_image_classification.classification import supervised_classification

# Paths to your input image, labeled shapefile, and output files
input_image = 'path/to/input_image.tif'
label_shapefile = 'path/to/polygons.shp'
output_image = 'path/to/output_image.tif'
model_output = 'path/to/model.pkl'
metrics_output = 'path/to/metrics.csv'
cm_output = 'path/to/confusion_matrix.png'

# Perform classification using Random Forest
classify(input_image, label_shapefile, output_image, algorithm='random_forest', val_split=0.3, model_output=model_output, metrics_output=metrics_output, cm_output=cm_output, n_estimators=100)
```

新しい衛星画像に対して推論を行うには、`inference`関数を使用します。
```python
from satellite_image_classification.classification import inference

# Paths to your input image, trained model, and output file
test_image = 'path/to/new_input_image.tif'
model_path = 'path/to/model.pkl'
output_image = 'path/to/output_image.tif'

# Perform inference using the trained model
inference(test_image, model_path, output_image)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yourusername/satellite_image_classifier",
    "name": "satellite-image-classifier",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "your.email@example.com",
    "download_url": "https://files.pythonhosted.org/packages/28/9a/87937540974f5d2ac5a6f607c5dbdd275a41ef9bea005ce441509efcf192/satellite_image_classifier-0.3.0.tar.gz",
    "platform": null,
    "description": "# Satellite Image Classification\r\n![alt text](image1.png)\r\n## Overview\r\nThis project provides a set of tools for classifying satellite images using various machine learning algorithms. The package supports supervised and unsupervised classification with Random Forest, Support Vector Machine (SVM), K-Nearest Neighbors (KNN), Logistic Regression, Maximum Likelihood, and Neural Networks. It also includes functionality for evaluating the classification model and using the trained model for inference on new images.\r\n## Features\r\n- Classification with various machine learning algorithms\r\n- Customizable validation split\r\n- Evaluation metrics (accuracy, kappa, F1 score) and confusion matrix visualization\r\n- Model saving and loading for inference on new data\r\n## Installation\r\nTo install the package, use pip:\r\n\r\n```pip install satellite-image-classification```\r\n## Usage\r\n### Training\r\nTo perform classification on a satellite image, use the `classify` function. This function allows you to choose the algorithm and its parameters, as well as specify the validation split for training and evaluation.\r\n\r\nExample\r\n\r\n```python\r\nfrom satellite_image_classification.classification import classify\r\n\r\n# Paths to your input image, labeled shapefile, and output files\r\ninput_image = 'path/to/input_image.tif'\r\nlabel_shapefile = 'path/to/polygons.shp'\r\noutput_image = 'path/to/output_image.tif'\r\nmodel_output = 'path/to/model.pkl'\r\nmetrics_output = 'path/to/metrics.csv'\r\ncm_output = 'path/to/confusion_matrix.png'\r\n\r\n# Perform classification using Random Forest\r\nclassify(input_image, label_shapefile, output_image, algorithm='random_forest', val_split=0.3, model_output=model_output, metrics_output=metrics_output, cm_output=cm_output, n_estimators=100)\r\n```\r\n\r\nSupported Algorithms\r\n- `random_forest`:  RandomForestClassifier (parameters: `n_estimators`)\r\n- `svm`: SVC (parameters: `C`, `kernel`)\r\n- `knn`: KNeighborsClassifier(parameters:`n_neighbors`)\r\n- `maximum_likelihood`: GaussianNB\r\n\r\n### Inference\r\nTo use a trained model for inference on a new satellite image, use the `inference` function.\r\n\r\nExample\r\n\r\n```python\r\nfrom satellite_image_classification.classification import inference\r\n\r\n# Paths to your input image, trained model, and output file\r\ntest_image = 'path/to/new_input_image.tif'\r\nmodel_path = 'path/to/model.pkl'\r\noutput_image = 'path/to/output_image.tif'\r\n\r\n# Perform inference using the trained model\r\ninference(test_image, model_path, output_image)\r\n```\r\n\r\n\r\n# \u885b\u661f\u753b\u50cf\u5206\u985e\r\n\r\n## \u6982\u8981\r\n\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u6a5f\u68b0\u5b66\u7fd2\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4f7f\u7528\u3057\u3066\u885b\u661f\u753b\u50cf\u3092\u5206\u985e\u3059\u308b\u305f\u3081\u306e\u30c4\u30fc\u30eb\u30bb\u30c3\u30c8\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u30e9\u30f3\u30c0\u30e0\u30d5\u30a9\u30ec\u30b9\u30c8\u3001\u30b5\u30dd\u30fc\u30c8\u30d9\u30af\u30bf\u30fc\u30de\u30b7\u30f3\uff08SVM\uff09\u3001K\u6700\u8fd1\u508d\u6cd5\uff08KNN\uff09\u3001\u30ed\u30b8\u30b9\u30c6\u30a3\u30c3\u30af\u56de\u5e30\u3001\u6700\u5c24\u6cd5\u3001\u30cb\u30e5\u30fc\u30e9\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4f7f\u7528\u3057\u305f\u5206\u985e\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u5206\u985e\u30e2\u30c7\u30eb\u306e\u8a55\u4fa1\u3084\u65b0\u3057\u3044\u753b\u50cf\u3078\u306e\u63a8\u8ad6\u306e\u305f\u3081\u306e\u6a5f\u80fd\u3082\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\r\n## \u7279\u5fb4\r\n- \u3055\u307e\u3056\u307e\u306a\u6a5f\u68b0\u5b66\u7fd2\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3092\u4f7f\u7528\u3057\u305f\u5206\u985e\r\n- \u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u306a\u5b66\u7fd2\u691c\u8a3c\u5206\u5272\r\n- \u8a55\u4fa1\u6307\u6a19\uff08\u7cbe\u5ea6\u3001kappa\u3001F1\u30b9\u30b3\u30a2\uff09\u304a\u3088\u3073\u6df7\u540c\u884c\u5217\u306e\u53ef\u8996\u5316\r\n- \u65b0\u3057\u3044\u30c7\u30fc\u30bf\u306b\u5bfe\u3059\u308b\u63a8\u8ad6\r\n## \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\r\n\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306b\u306f\u3001pip\u3092\u4f7f\u7528\u3057\u307e\u3059\uff1a\r\n\r\n```pip install satellite-image-classification```\r\n\r\n## \u4f7f\u7528\r\n\u885b\u661f\u753b\u50cf\u306e\u5206\u985e\u3092\u884c\u3046\u306b\u306f\u3001`classify`\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u3067\u306f\u3001\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u3068\u305d\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u9078\u629e\u3057\u3001\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3068\u8a55\u4fa1\u306e\u305f\u3081\u306e\u691c\u8a3c\u5206\u5272\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\r\n```python\r\nfrom satellite_image_classification.classification import supervised_classification\r\n\r\n# Paths to your input image, labeled shapefile, and output files\r\ninput_image = 'path/to/input_image.tif'\r\nlabel_shapefile = 'path/to/polygons.shp'\r\noutput_image = 'path/to/output_image.tif'\r\nmodel_output = 'path/to/model.pkl'\r\nmetrics_output = 'path/to/metrics.csv'\r\ncm_output = 'path/to/confusion_matrix.png'\r\n\r\n# Perform classification using Random Forest\r\nclassify(input_image, label_shapefile, output_image, algorithm='random_forest', val_split=0.3, model_output=model_output, metrics_output=metrics_output, cm_output=cm_output, n_estimators=100)\r\n```\r\n\r\n\u65b0\u3057\u3044\u885b\u661f\u753b\u50cf\u306b\u5bfe\u3057\u3066\u63a8\u8ad6\u3092\u884c\u3046\u306b\u306f\u3001`inference`\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\r\n```python\r\nfrom satellite_image_classification.classification import inference\r\n\r\n# Paths to your input image, trained model, and output file\r\ntest_image = 'path/to/new_input_image.tif'\r\nmodel_path = 'path/to/model.pkl'\r\noutput_image = 'path/to/output_image.tif'\r\n\r\n# Perform inference using the trained model\r\ninference(test_image, model_path, output_image)\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package for satellite image classification",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/yourusername/satellite_image_classifier"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bce1e72f20c47a7822d62ff1e6f869ec27a235363b67349bdaabc536a1e25bd",
                "md5": "aaac2cb361f84b2ee3cb6e5c7816036a",
                "sha256": "eec68a3d70277f017c07901ef8f4e2e59b4a39f49100b908919bc7f350568fb3"
            },
            "downloads": -1,
            "filename": "satellite_image_classifier-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aaac2cb361f84b2ee3cb6e5c7816036a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 6227,
            "upload_time": "2024-07-11T08:20:48",
            "upload_time_iso_8601": "2024-07-11T08:20:48.649807Z",
            "url": "https://files.pythonhosted.org/packages/0b/ce/1e72f20c47a7822d62ff1e6f869ec27a235363b67349bdaabc536a1e25bd/satellite_image_classifier-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "289a87937540974f5d2ac5a6f607c5dbdd275a41ef9bea005ce441509efcf192",
                "md5": "c2efdd46926a9e2e6097f5af37c4817e",
                "sha256": "45dabb52e6cc6058a3c5f3f114bb4abde50a4536309ffd69c36c77f1668201e8"
            },
            "downloads": -1,
            "filename": "satellite_image_classifier-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c2efdd46926a9e2e6097f5af37c4817e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5362,
            "upload_time": "2024-07-11T08:20:52",
            "upload_time_iso_8601": "2024-07-11T08:20:52.087232Z",
            "url": "https://files.pythonhosted.org/packages/28/9a/87937540974f5d2ac5a6f607c5dbdd275a41ef9bea005ce441509efcf192/satellite_image_classifier-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-11 08:20:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "satellite_image_classifier",
    "github_not_found": true,
    "lcname": "satellite-image-classifier"
}
        
Elapsed time: 0.26776s