Metadata-Version: 2.1
Name: vancouver_watching
Version: 3.381.1
Summary: 🌈 Vancouver Watching with AI.
Home-page: https://github.com/kamangir/vancouver-watching
Author: Arash Abadpour (Kamangir)
Author-email: arash@kamangir.net
License: Public Domain
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Unix Shell
Classifier: License :: Public Domain
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: blueness
Requires-Dist: abcli
Requires-Dist: beautifulsoup4
Requires-Dist: boto3
Requires-Dist: folium
Requires-Dist: geojson
Requires-Dist: geopandas
Requires-Dist: matplotlib
Requires-Dist: opencv-python
Requires-Dist: pymysql==0.10.1
Requires-Dist: pyyaml
Requires-Dist: pylint
Requires-Dist: pytest
Requires-Dist: python-dotenv[cli]
Requires-Dist: requests
Requires-Dist: tqdm

# 🌈 Vancouver Watching (`vanwatch`)

`vanwatch` 🌈 discovers and ingests images from traffic cameras in an area and then runs [YOLO 🚀](https://github.com/ultralytics/ultralytics), [OpenAI Vision](https://github.com/kamangir/openai_commands#vision), and other vision algo to extract information about urban activity at scale.

```bash
pip install vancouver-watching
```

```bash
 > vanwatch help
vanwatch conda create [validate,~recreate]
 . create conda environment.
vanwatch conda validate
 . validate conda environment.
vanwatch discover \
	[area=<area>,~upload] \
	[-|<object-name>] \
	[<args>]
 . discover area -> <object-name>.
vanwatch ingest \
	area=<area>,count=<count>,dryrun,gif,model=<model-id>,~process,publish,~upload \
	-|<object-name> \
	[<args>]
 . ingest <area> -> <object-name>.
vanwatch list [area=<area>,discovery|ingest,published] \
	[--count <count>] \
	[--delim space] \
	[--log 0] \
	[--offset <offset>]
 . list objects from area.
2 area(s): iran,vancouver
vanwatch list areas
 . list areas.
vanwatch vision "prompt" \
	[area=<area>,offset=<1>,auto|low|high,dryrun,~upload] \
	Davie,Bute \
	[--verbose 1]
 . openai_commands vision: prompt @ <area>/intersection.
vanwatch process \
	count=<count>,~download,gif,model=<model-id>,publish,~upload \
	.|<object-name> \
	[--detect_objects 0] \
	[--do_dryrun 1] \
	[--overwrite 1] \
	[--verbose 1]
 . process <object-name>.
vanwatch pylint
 . pylint vancouver_watching.
vanwatch update|update_cache \
	area=<vancouver>,overwrite,process,~publish,refresh,~upload \
	[--verbose 1]
 . update QGIS cache.
vancouver_watching test \
	[dryrun,~ingest,~list,~process,upload]
 . test vancouver_watching.
```

last build [🔗](https://kamangir-public.s3.ca-central-1.amazonaws.com/test_vancouver_watching_ingest/animation.gif) ![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/test_vancouver_watching_ingest/animation.gif?raw=true)

## discover and Ingest an Area

![image](https://user-images.githubusercontent.com/1007567/196573547-b1c71b3b-7fac-4d2c-bba0-a87b063830da.png)

to see the list of areas supported by `vanwatch` type in,

```bash
vanwatch list areas
```

to discover the available cameras in an area type in,

```bash
vanwatch discover area=vancouver
```

you have generated a `geojson` of [traffic images in the City of Vancouver](https://raw.githubusercontent.com/kamangir/vancouver-watching/main/data/vancouver.geojson). Now, you can ingest the traffic images from this area and detect people and cars in them,

```bash
vanwatch ingest area=vancouver,count=2,publish
```

![image](https://github.com/kamangir/assets/blob/main/vanwatch/2023-11-25-openai-vision/DavieWestBute-inference.jpg?raw=true)

model: https://hub.ultralytics.com/models/R6nMlK6kQjSsQ76MPqQM?tab=preview

[![image](https://github.com/kamangir/assets/blob/main/vanwatch/2023-11-25-openai-vision/QGIS.png?raw=true)](https://raw.githubusercontent.com/kamangir/vancouver-watching/main/QGIS/2023-11-12-12-03-40-85851.geojson)

![image](https://github.com/kamangir/assets/blob/main/vanwatch/2023-11-12-14-42-23-96479.gif?raw=true?raw=1)

![image](https://github.com/kamangir/assets/blob/main/vanwatch/2024-01-06-20-39-46-73614-QGIS.gif?raw=true?raw=1)

dataset: [vanwatch-cache-2024-02-28-21-04-19-26236.tar.gz](https://kamangir-public.s3.ca-central-1.amazonaws.com/vanwatch-cache-2024-02-28-21-04-19-26236.tar.gz) ([details](https://medium.com/@arash-kamangir/vancouver-watching-with-ai-37-72b6a032b7fa)).

---

[![PyPI version](https://img.shields.io/pypi/v/vancouver-watching.svg)](https://pypi.org/project/vancouver-watching/)

to use on [AWS SageMaker](https://aws.amazon.com/sagemaker/) replace `<plugin-name>` with `vanwatch` and follow [these instructions](https://github.com/kamangir/notebooks-and-scripts/blob/main/SageMaker.md).
