{"id":21745486,"url":"https://github.com/palmerabollo/nomorecats","last_synced_at":"2025-10-08T09:15:31.853Z","repository":{"id":141703427,"uuid":"155929029","full_name":"palmerabollo/nomorecats","owner":"palmerabollo","description":"Chrome extension that hides all those annoying kitties","archived":false,"fork":false,"pushed_at":"2018-11-18T18:14:26.000Z","size":8333,"stargazers_count":8,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T05:12:42.815Z","etag":null,"topics":["chrome-extension","proof-of-concept","tensorflow","tensorflow-js"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/palmerabollo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2018-11-02T22:45:03.000Z","updated_at":"2023-02-06T18:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"2819a6a0-9bb1-4a01-a33d-a9f71882931b","html_url":"https://github.com/palmerabollo/nomorecats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/palmerabollo/nomorecats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palmerabollo%2Fnomorecats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palmerabollo%2Fnomorecats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palmerabollo%2Fnomorecats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palmerabollo%2Fnomorecats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palmerabollo","download_url":"https://codeload.github.com/palmerabollo/nomorecats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palmerabollo%2Fnomorecats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261344528,"owners_count":23144884,"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":["chrome-extension","proof-of-concept","tensorflow","tensorflow-js"],"created_at":"2024-11-26T07:15:45.933Z","updated_at":"2025-10-08T09:15:31.847Z","avatar_url":"https://github.com/palmerabollo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# No more cats\n\nChrome extension that blocks all those annoying cats online.\n\n![example](./docs/nomorecats.gif)\n\n## Install\n\nClone the project:\n\n```sh\ngit clone git@github.com:palmerabollo/nomorecats.git\ncd nomorecats\n```\n\nIn Google Chrome:\n- Open **`chrome://extensions`**\n- Enable the `\"Developer Mode\"` toggle.\n- Click `\"Load unpacked\"` and open the \"nomorecats\" project you cloned before.\n\nOnce the plugin is loaded you'll see a new card. There is an **\"Inspect views `background.html`\"** link that lets you debug the `background.js` script containing all the tensorflow magic.\n\nEvery time you open a page with images, they will be processed and you'll see a log like the following one:\n\n```\nReadable prediction for https://images.pexels.com/photos/416160/pexels-photo-416160.jpeg?auto=compress\u0026cs=tinysrgb\u0026h=350\nFloat32Array(2) [0.43529072403907776, 0.5647093057632446]\n````\n\nThe Float32Array contains two elements. The first one (`p`) is the probability to be a cat. The second one is `1-p`.\n\n## Train a new model\n\nThe extension uses a MobileNet model trained with tensorflow and converted to tensorflowjs to be used in the extension.\n\n### Install prerequisites\n\n- jq\n- tensorflow: `pip install --upgrade \"tensorflow==1.7.*\"`\n- tensorflowjs: `pip install tensorflowjs`\n\n### Train a new model:\n\n```sh\ngit clone https://github.com/googlecodelabs/tensorflow-for-poets-2\n\ncd tensorflow-for-poets\n\nexport IMAGE_SIZE=224\nexport ARCHITECTURE=\"mobilenet_0.50_$IMAGE_SIZE\"\n\n#\n# copy the \"dataset\" folder in the repo to tf_files\n#\n\n# Train the model\npython -m scripts.retrain \\\n  --bottleneck_dir=tf_files/bottlenecks \\\n  --how_many_training_steps=500 \\\n  --model_dir=tf_files/models/ \\\n  --summaries_dir=tf_files/training_summaries/\"$ARCHITECTURE\" \\\n  --output_graph=tf_files/retrained_graph.pb \\\n  --output_labels=tf_files/retrained_labels.txt \\\n  --architecture=\"$ARCHITECTURE\" \\\n  --image_dir=tf_files/dataset\n\n# Convert to tensorflowjs\ntensorflowjs_converter \\\n  --input_format=tf_frozen_model \\\n  --output_node_names=final_result \\\n  tf_files/retrained_graph.pb \\\n  tf_files/web\n\n#\n# Quantize \u0026 optimize not mandatory.\n# Skip them for now for simplicity.\n#\n\n# Generate labels.json from retrained_labels.txt\ncat tf_files/retrained_labels.txt | jq -Rsc '. / \"\\n\" - [\"\"]' \u003e tf_files/web/labels.json\n```\n\nNow copy everything under tf_files/web to the extension's `\"tensorflow\"` folder and reload the extension in Google Chrome.\n\n## References\n\n- https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/\n- https://index.pocketcluster.io/woudsma-retrain-mobilenet-for-the-web.html\n- https://proandroiddev.com/re-training-the-model-with-images-using-tensorflow-7758e9eb8db5\n- https://js.tensorflow.org/tutorials/import-saved-model.html\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmerabollo%2Fnomorecats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalmerabollo%2Fnomorecats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalmerabollo%2Fnomorecats/lists"}