| Name | picarta JSON |
| Version |
0.4
JSON |
| download |
| home_page | https://github.com/PicartaAI/Picarta-API |
| Summary | A package to geolocate images from URL or local files using Picarta AI |
| upload_time | 2024-08-03 12:09:08 |
| maintainer | None |
| docs_url | None |
| author | Picarta |
| requires_python | >=3.6 |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# Picarta
A Python package to geolocate images from URL or local files using [Picarta.ai](https://picarta.ai) API 🌍🔍.
### Overview
The Picarta Image Geolocalization [API](https://picarta.ai/api) allows users to localize images and obtain predictions about their geographic location based on their content and/or embedded metadata. Users can provide an image either from a local file or via a URL and receive predictions about the location depicted in the image. The API returns information such as city, province, country, GPS coordinates, and confidence scores for each prediction.
### Authentication
To access the [API](https://picarta.ai/api), users need to provide an API token in the request headers. Users can obtain an API token by registering on the [Picarta](https://picarta.ai) website.
### Installation
To install the `picarta` package, use pip:
```bash
pip install picarta
```
### Usage
#### Request Format
The API accepts HTTP POST requests with a JSON payload containing the following parameters:
- `TOKEN`: User's API token.
- `IMAGE`: image path or URL of the image to localize.
- `TOP_K` (Optional): Number of top predictions to return (default is 10, maximum is 100).
- `Center_LATITUDE` (Optional): Latitude of the center of the search area.
- `Center_LONGITUDE` (Optional): Longitude of the center of the search area.
- `RADIUS` (Optional): Radius of the search area around the center point in kilometers.
#### Example Request using the `picarta` Package
```python
from picarta import Picarta
api_token = "YOUR_API_TOKEN"
localizer = Picarta(api_token)
# Geolocate a local image
result = localizer.localize(img_path="/path/to/local/image.jpg")
print(result)
# Geolocate an image from URL with optional parameters for a specific location search
result = localizer.localize(
img_path="https://upload.wikimedia.org/wikipedia/commons/8/83/San_Gimignano_03.jpg",
top_k=10,
center_latitude=43.464,
center_longitude=11.038,
radius=100)
print(result)
```
#### Response Format
The API returns a JSON object containing geographic location results, including metadata about the image and a dictionary of topk predictions.
#### Example API Response
```json
{
"ai_country": "Fiji",
"ai_lat": -10.932661290178117,
"ai_lon": 173.54167690802137,
"camera_maker": "NIKON CORPORATION",
"camera_model": "NIKON D200",
"city": "Ahau",
"confidence": 0.7205776784126713,
"province": "Rotuma",
"timestamp": "2010:09:21 12:04:46",
"topk_predictions_dict": {
"1": {
"address": {"city": "Ahau", "country": "Fiji", "province": "Rotuma"},
"confidence": 0.7205776784126713,
"gps": [-10.932661290178117, 173.54167690802137]
},
"2": {
"address": {"city": "Nghi Xuan", "country": "Vietnam", "province": "Ha Tinh"},
"confidence": 0.13465818962254223,
"gps": [18.831436938230198, 106.00851919090474]
},
"3": {
"address": {"city": "Hanga Roa", "country": "Chile", "province": "Valparaiso"},
"confidence": 0.03465818962254226,
"gps": [-42.42505486943787, -118.63631306266818]
}
}
}
```
#### Additional Notes
- `topk_predictions_dict` is presented in the second version of the API.
- `topk_predictions_dict[1]` is equal to province, ai_country, city, ai_lat, ai_lon, and ai_confidence. (It shows the top 1 result, which was in the first version of the API).
- The API could also return the following values if the EXIF data exists in the images:
- `exif_lat`: Latitude from EXIF metadata.
- `exif_lon`: Longitude from EXIF metadata.
- `exif_country`: Country name from EXIF metadata.
### Contact Information
For any inquiries or assistance, feel free to contact us via:
- Email: [info@picarta.ai](mailto:info@picarta.ai)
- Discord: [Join our Discord channel](https://discord.gg/g5BAd2UFbs)
- Share your feedback: [API Feedback Survey](https://forms.gle/JokVe1ZRKP1hjsA49)
Raw data
{
"_id": null,
"home_page": "https://github.com/PicartaAI/Picarta-API",
"name": "picarta",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Picarta",
"author_email": "info@picarta.ai",
"download_url": "https://files.pythonhosted.org/packages/b4/4c/b035d3c6dcd524d81bebfabad5bc335792ef94318a679d208d5e66339af5/picarta-0.4.tar.gz",
"platform": null,
"description": "# Picarta\n\nA Python package to geolocate images from URL or local files using [Picarta.ai](https://picarta.ai) API \ud83c\udf0d\ud83d\udd0d.\n\n\n### Overview\n\nThe Picarta Image Geolocalization [API](https://picarta.ai/api) allows users to localize images and obtain predictions about their geographic location based on their content and/or embedded metadata. Users can provide an image either from a local file or via a URL and receive predictions about the location depicted in the image. The API returns information such as city, province, country, GPS coordinates, and confidence scores for each prediction.\n\n### Authentication\n\nTo access the [API](https://picarta.ai/api), users need to provide an API token in the request headers. Users can obtain an API token by registering on the [Picarta](https://picarta.ai) website.\n\n### Installation\n\nTo install the `picarta` package, use pip:\n\n```bash\npip install picarta\n```\n\n### Usage\n\n#### Request Format\n\nThe API accepts HTTP POST requests with a JSON payload containing the following parameters:\n\n- `TOKEN`: User's API token.\n- `IMAGE`: image path or URL of the image to localize.\n- `TOP_K` (Optional): Number of top predictions to return (default is 10, maximum is 100).\n- `Center_LATITUDE` (Optional): Latitude of the center of the search area.\n- `Center_LONGITUDE` (Optional): Longitude of the center of the search area.\n- `RADIUS` (Optional): Radius of the search area around the center point in kilometers.\n\n#### Example Request using the `picarta` Package\n\n```python\nfrom picarta import Picarta\n\napi_token = \"YOUR_API_TOKEN\"\nlocalizer = Picarta(api_token)\n\n# Geolocate a local image\nresult = localizer.localize(img_path=\"/path/to/local/image.jpg\")\n\nprint(result)\n\n# Geolocate an image from URL with optional parameters for a specific location search\nresult = localizer.localize(\nimg_path=\"https://upload.wikimedia.org/wikipedia/commons/8/83/San_Gimignano_03.jpg\",\ntop_k=10,\ncenter_latitude=43.464, \ncenter_longitude=11.038,\nradius=100)\n\nprint(result)\n\n```\n\n#### Response Format\nThe API returns a JSON object containing geographic location results, including metadata about the image and a dictionary of topk predictions.\n\n#### Example API Response\n\n```json\n{\n \"ai_country\": \"Fiji\",\n \"ai_lat\": -10.932661290178117,\n \"ai_lon\": 173.54167690802137,\n \"camera_maker\": \"NIKON CORPORATION\",\n \"camera_model\": \"NIKON D200\",\n \"city\": \"Ahau\",\n \"confidence\": 0.7205776784126713,\n \"province\": \"Rotuma\",\n \"timestamp\": \"2010:09:21 12:04:46\",\n \"topk_predictions_dict\": {\n \"1\": {\n \"address\": {\"city\": \"Ahau\", \"country\": \"Fiji\", \"province\": \"Rotuma\"},\n \"confidence\": 0.7205776784126713,\n \"gps\": [-10.932661290178117, 173.54167690802137]\n },\n \"2\": {\n \"address\": {\"city\": \"Nghi Xuan\", \"country\": \"Vietnam\", \"province\": \"Ha Tinh\"},\n \"confidence\": 0.13465818962254223,\n \"gps\": [18.831436938230198, 106.00851919090474]\n },\n \"3\": {\n \"address\": {\"city\": \"Hanga Roa\", \"country\": \"Chile\", \"province\": \"Valparaiso\"},\n \"confidence\": 0.03465818962254226,\n \"gps\": [-42.42505486943787, -118.63631306266818]\n }\n }\n}\n```\n\n#### Additional Notes\n\n- `topk_predictions_dict` is presented in the second version of the API.\n- `topk_predictions_dict[1]` is equal to province, ai_country, city, ai_lat, ai_lon, and ai_confidence. (It shows the top 1 result, which was in the first version of the API).\n- The API could also return the following values if the EXIF data exists in the images:\n - `exif_lat`: Latitude from EXIF metadata.\n - `exif_lon`: Longitude from EXIF metadata.\n - `exif_country`: Country name from EXIF metadata.\n\n### Contact Information\n\nFor any inquiries or assistance, feel free to contact us via:\n\n- Email: [info@picarta.ai](mailto:info@picarta.ai)\n- Discord: [Join our Discord channel](https://discord.gg/g5BAd2UFbs)\n- Share your feedback: [API Feedback Survey](https://forms.gle/JokVe1ZRKP1hjsA49)\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A package to geolocate images from URL or local files using Picarta AI",
"version": "0.4",
"project_urls": {
"Homepage": "https://github.com/PicartaAI/Picarta-API"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0b700e9788d6636532f82950153cb70db8644464d30416433793a996d1384ad",
"md5": "699d01cd6f8d7058a9602758606f1c65",
"sha256": "d25ad3e70c459df18a1fa248737eaf90e44f128a6973d24b461574fe914b58a6"
},
"downloads": -1,
"filename": "picarta-0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "699d01cd6f8d7058a9602758606f1c65",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4687,
"upload_time": "2024-08-03T12:09:07",
"upload_time_iso_8601": "2024-08-03T12:09:07.573169Z",
"url": "https://files.pythonhosted.org/packages/b0/b7/00e9788d6636532f82950153cb70db8644464d30416433793a996d1384ad/picarta-0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b44cb035d3c6dcd524d81bebfabad5bc335792ef94318a679d208d5e66339af5",
"md5": "24262f6723209d82beed5a4be09c2c84",
"sha256": "492dac65f72f9f1346eeaf70c739abf16f53d9c87243ff7387770d5323125b64"
},
"downloads": -1,
"filename": "picarta-0.4.tar.gz",
"has_sig": false,
"md5_digest": "24262f6723209d82beed5a4be09c2c84",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3983,
"upload_time": "2024-08-03T12:09:08",
"upload_time_iso_8601": "2024-08-03T12:09:08.760605Z",
"url": "https://files.pythonhosted.org/packages/b4/4c/b035d3c6dcd524d81bebfabad5bc335792ef94318a679d208d5e66339af5/picarta-0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-03 12:09:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PicartaAI",
"github_project": "Picarta-API",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "picarta"
}