{"id":16272030,"url":"https://github.com/sshh12/webcam-anomaly-detection","last_synced_at":"2025-04-08T15:45:04.012Z","repository":{"id":70737781,"uuid":"93334623","full_name":"sshh12/Webcam-Anomaly-Detection","owner":"sshh12","description":"An FTP server that logs anomalous motion from a camera stream.","archived":false,"fork":false,"pushed_at":"2017-11-03T23:42:30.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T12:17:38.049Z","etag":null,"topics":["anomaly-detection","ftp","keras-tensorflow","pyftpdlib","skimage","webcam"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sshh12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-04T18:51:26.000Z","updated_at":"2017-06-04T20:16:47.000Z","dependencies_parsed_at":"2023-02-22T22:15:20.622Z","dependency_job_id":null,"html_url":"https://github.com/sshh12/Webcam-Anomaly-Detection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshh12%2FWebcam-Anomaly-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshh12%2FWebcam-Anomaly-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshh12%2FWebcam-Anomaly-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshh12%2FWebcam-Anomaly-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshh12","download_url":"https://codeload.github.com/sshh12/Webcam-Anomaly-Detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247874006,"owners_count":21010572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anomaly-detection","ftp","keras-tensorflow","pyftpdlib","skimage","webcam"],"created_at":"2024-10-10T18:15:52.054Z","updated_at":"2025-04-08T15:45:03.981Z","avatar_url":"https://github.com/sshh12.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webcam Anomaly Detection\n\nAn FTP server that logs anomalous motion from a camera stream.\n\n## Dependencies\n* [NumPy](http://www.numpy.org/)\n* [Keras](https://keras.io)\n* [scikit-image](http://scikit-image.org)\n* [pyftpdlib](https://github.com/giampaolo/pyftpdlib)\n\n## What\nWhen working with basic FTP webcam streams, it's easy to end up with disk-fulls of image data.\nA basic solution is to delete old footage automatically, but this can end up deleting important events.\nAnother idea is to analyze the change between every image and only save them if enough pixels changed\nindicating motion. While this works sometimes, in situations where the camera is positioned in front of trees or towards\nclouds the system will often end up with a plethora of false positives. This project aims to fix this by\nusing machine learning to determine what is anomalous motion. It does this by creating a delta image (dI = |old-new|) and classifying it as either noise or an anomaly. This way only key frames stay while pictures that only show leaves moving are discarded.\n\n## Usage\n\n#### Install\n1. ```git clone https://github.com/sshh12/Webcam-Anomaly-Detection.git```\n2. ```pip install -r requirements.txt``` (For Keras, [Tensorflow](https://www.tensorflow.org/) or [Theano](http://deeplearning.net/software/theano/) is required)\n\n#### Setup\n1. Find a camera that supports FTP logging\n2. Create a username and password then add it to the ```config.py```\n3. Set ```TRAIN = True``` in ```config.py```\n4. Point the camera to the IP (and port 21) of your computer\n5. Run ```main.py```, this will populate the training folder with a constant stream of images and delta images (dimages)\n6. Once a bunch (\u003e1000) of images have been collected, drag the dimages (\\*.d.jpg) into either the anomaly or noise folder\n7. Run ```generate_anomaly_model.py``` to generate a model to predict future dimages (this will take a while)\n8. Set ```TRAIN = False``` in ```config.py``` and optionally delete the contents of the training folder\n\n#### Running\n1. Run ```main.py```\n2. Check the images folder to see if images are being saved\n3. Close the window or press Ctrl-C to stop the server\n\n### Example Delta Images\n\n#### Anomaly\n![Anomaly](https://user-images.githubusercontent.com/6625384/26891644-64de5080-4b7b-11e7-8960-57ce75c99e28.jpg)\n\n#### Noise\n![Noise](https://user-images.githubusercontent.com/6625384/26891700-964a0c90-4b7b-11e7-8a69-99525a83bfcb.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshh12%2Fwebcam-anomaly-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshh12%2Fwebcam-anomaly-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshh12%2Fwebcam-anomaly-detection/lists"}