{"id":23136832,"url":"https://github.com/aitikgupta/e-rotanet","last_synced_at":"2025-08-17T10:32:29.133Z","repository":{"id":51072972,"uuid":"275992219","full_name":"aitikgupta/E-RotaNet","owner":"aitikgupta","description":"Let the model rotate images according to human-perception, a CV pipeline.","archived":false,"fork":false,"pushed_at":"2021-05-25T03:47:09.000Z","size":53792,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-05-01T02:50:26.895Z","etag":null,"topics":["computer-vision","hacktoberfest","human-perception","machine-learning","rotation"],"latest_commit_sha":null,"homepage":"https://aitikgupta.github.io/e-rotanet/","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/aitikgupta.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}},"created_at":"2020-06-30T03:56:42.000Z","updated_at":"2021-10-02T20:42:57.000Z","dependencies_parsed_at":"2022-09-10T16:01:25.783Z","dependency_job_id":null,"html_url":"https://github.com/aitikgupta/E-RotaNet","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitikgupta%2FE-RotaNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitikgupta%2FE-RotaNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitikgupta%2FE-RotaNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitikgupta%2FE-RotaNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aitikgupta","download_url":"https://codeload.github.com/aitikgupta/E-RotaNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230116087,"owners_count":18175693,"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":["computer-vision","hacktoberfest","human-perception","machine-learning","rotation"],"created_at":"2024-12-17T12:25:54.159Z","updated_at":"2024-12-17T12:25:54.965Z","avatar_url":"https://github.com/aitikgupta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-RotaNet\n### Learning the context of images, and rotating them according to human-perception.\n\n## Demo\n\u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/demo.gif\"\u003e\n\n### Note: Screenshots at the bottom\n#### What is 'E' in E-Rotanet?\n'E' stands for the Efficientnet backbone used in the model, to learn the features and the context of the images.\u003cbr\u003e\n*EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models.*\n\n#### About the dataset\nThe released models are trained on [Google Street View](https://www.crcv.ucf.edu/data/GMCP_Geolocalization/) dataset, which contains ~62k images which contain mostly human-perception viewing angles of streets and buildings. \n\n#### Reproducing Results\nNote: I highly recommend using [Anaconda](https://anaconda.org/) to maintain the environments.\n\n\n```\ngit clone https://github.com/aitikgupta/E-RotaNet.git\ncd E-RotaNet\nconda env create -f environment.yml\nconda activate e-rotanet\n```\n\n\n*   #### Using the flask application to test the model              \n      ```\n      python E-RotaNet.py\n      ```\n      The flask application will run on http://127.0.0.1:5000/\n*   #### Training the model from scratch\n    Note: Training the model will consume around 1-1.5 hours of GPU\n      ```\n      python src/train.py --help\n      \u003e\u003eusage: train.py\n                [-h] [--image_dir IMAGE_DIR] [--model_save MODEL_SAVE]\n                [--resume_training RESUME_TRAINING] [--tb_dir TB_DIR]\n                [--batch_size BATCH_SIZE] [--n_epochs N_EPOCHS]\n                [--val_split VAL_SPLIT] [--img_size IMG_SIZE] [--regress]\n                [--device DEVICE]\n\n        optional arguments:\n          -h, --help            show this help message and exit\n          --image_dir IMAGE_DIR\n                                Path to images directory\n          --model_save MODEL_SAVE\n                                Model output directory\n          --resume_training RESUME_TRAINING\n                                Path to model checkpoint to resume training\n          --tb_dir TB_DIR       Tensorboard logs directory\n          --batch_size BATCH_SIZE\n                                Batch size\n          --n_epochs N_EPOCHS   Number of epochs\n          --val_split VAL_SPLIT\n                                Validation split for images, eg. (0.2)\n          --img_size IMG_SIZE   Input size of image to the model, eg. (224,224)\n          --regress             Use regression instead of classification\n          --device DEVICE       Use device for inference (gpu/cpu)\n      ```\n*   #### Evaluating a trained model\n    Note: 2-ways to proceed:\u003cbr\u003e\n\n      1.   Evaluate an image directory (Images will be randomly rotated) \n      2.   Evaluate a single image (Image will be rotated from 0-\u003e360 degrees and mean error will be printed)\n\n\n      ```\n      python src/evaluate.py --help\n      \u003e\u003eusage: evaluate.py [-h] [--model_dir MODEL_DIR] [--eval_dir EVAL_DIR]\n                   [--eval_single EVAL_SINGLE] [--batch_size BATCH_SIZE]\n                   [--img_size IMG_SIZE] [--regress] [--device DEVICE]\n\n        optional arguments:\n          -h, --help            show this help message and exit\n          --model_dir MODEL_DIR\n                                Path to model\n          --eval_dir EVAL_DIR   Path to images directory (Images will be randomly\n                                rotated)\n          --eval_single EVAL_SINGLE\n                                Path to the image (Image will be rotated from 0 to 360\n                                degrees)\n          --batch_size BATCH_SIZE\n                                Batch size\n          --img_size IMG_SIZE   Input size of image to the model\n          --regress             Use regression instead of classification\n          --device DEVICE       Use device for inference (gpu/cpu)\n\n      ```\n\n#### Individual files can be run to view intermediate steps in the whole pipeline. Example:\n\n\n*   To look at how the loss function works:\n    ```\n    python src/loss.py\n    \u003e\u003eTotal Error: 0.7847222089767456\n      Absolute differences between angles:\n      Truth: 60.0, Pred: 355.0 ; Diff: 65.0\n      Truth: 90.0, Pred: 360.0 ; Diff: 90.0\n    ```\n*   \n    ```\n    python src/preprocess.py\n    \u003e\u003e[\u003cPIL.Image.Image image mode=RGB size=224x224 at 0x7F278C492B70\u003e, (1024, 1280, 3)]\n    ```\n    \u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Figure_1.png\" height=\"224\"\u003e\n\n    Note: The black corners are just for demonstration purpose, they're cropped in the actual pipeline\n\n*   Output from the model\n    ```\n    python src/predict.py \\\n            --image_path images/000001_0.jpg \\\n            --model_path release/model.h5 \\\n            --rotation -1 \\\n            --device cpu\n    \u003e\u003e[\u003cPIL.Image.Image image mode=RGB size=1024x1280 at 0x7F47D4765080\u003e, \u003cPIL.Image.Image image mode=RGB size=1024x1280 at 0x7F47D4765BE0\u003e, 163]\n    ```\n    \u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Figure_2.png\" height=\"224\"\u003e\n\n## Screenshots\n\u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Screenshot%20from%202020-06-30%2009-39-19.png\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Screenshot%20from%202020-06-30%2009-39-36.png\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Screenshot%20from%202020-06-30%2009-39-58.png\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/aitikgupta/E-RotaNet/master/screenshots/Screenshot%20from%202020-06-30%2009-40-12.png\"\u003e\n\n  #### Note: Model is still under development\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitikgupta%2Fe-rotanet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitikgupta%2Fe-rotanet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitikgupta%2Fe-rotanet/lists"}