diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..13566b81b018ad684f3a35fee301741b2734c8f4 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/csv-plugin.xml b/.idea/csv-plugin.xml new file mode 100644 index 0000000000000000000000000000000000000000..10f27c05856c0764ac4b15c77265e41a3f687194 --- /dev/null +++ b/.idea/csv-plugin.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/.idea/hateful-memes.iml b/.idea/hateful-memes.iml new file mode 100644 index 0000000000000000000000000000000000000000..d0876a78d06ac03b5d78c8dcdb95570281c6f1d6 --- /dev/null +++ b/.idea/hateful-memes.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..d9a1fb63d384faa4e8860dc77e9d924ad995ab4c --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,38 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..105ce2da2d6447d11dfe32bfb846c3d5b199fc99 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..2d49c523873d9fbddb5adabc377d9d70acd41b15 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app.py b/app.py index 641ff1a666a99dfb33d7bda0301a4b16b6db35c8..b81c54f71bc0f490551b8003aeb186fbd0b68c66 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,7 @@ import pickle from utils import get_image_arrays, get_image_predictions, show_image st.title('Hateful Memes Classification') -image_path = './' +image_path = './images' demo_data_file = 'demo_data.csv' demo_data = pd.read_csv('demo_data.csv') TFLITE_FILE_PATH = 'image_model.tflite' diff --git a/demo_data.csv b/demo_data.csv index 3f58d77f1e6fe63d39b85b9c0f8fe2eff35d6851..654d937e877f7334b67bcb21bfcd8bdcdd50d592 100644 --- a/demo_data.csv +++ b/demo_data.csv @@ -1,3 +1,51 @@ image_id,text,label 48539.png,"the woman you met who admits she's wrong, apologizes and changes her ways",0 64038.png,riding a horse backwards,0 +53467.png,how you look when youre black and you celebrate the 4th of july,0 +65297.png,when your little bomber brings home his first girlfriend,0 +26891.png,today we're making vegetable soup! the most disturbing thing i've seen all day.,1 +02846.png,the before image that not many people have seen,0 +06752.png,"the amish reject modern society without strapping explosives children proof that you can be completely devoted to your religion wear beards, dress modestly and reject modern society without strapping explosives to children",1 +09638.png,thanksgiving in china,1 +40218.png,some habits are hard to stop,0 +21386.png,the victoria's secret angels across america tour,0 +17209.png,stop saying my religion is violent.. i will kill you in the or name of my religion,1 +13874.png,ban the burka you must be fucking joking,0 +13069.png,replaced by misunderstood girlfriend doesn't get jealous,0 +48326.png,like i said. i'm an aries!,0 +16827.png,partial arts,0 +57908.png,wow. a muscle car am i supposed to be impressed by that?,0 +94380.png,that look when you high as fuck on dem chromosomes,1 +89136.png,this was fake news a lot of people don't realise it. please do your research,0 +95402.png,to all the high school grads... congratulations on getting through the easiest part of life,0 +74621.png,"""what kind of question is that? of course i fuck goat. next question...""",0 +23047.png,i like to play outside,0 +63097.png,like and share if you want loretta lynch investigated,0 +13726.png,"democrats giving rights to those who have no right to be here, while taking rights from those who do",0 +72450.png,the closest some of us will ever get to heaven,1 +84759.png,what if tornadoes are actually created secretly by the government to destroy white trash people living in trailer homes,1 +76180.png,how to get stoned without smoking weed,0 +96185.png,"i hate the chinese, black, white, mexican people so who do i like? therein lies the problem",1 +74259.png,i'll have 72 virgins when i die i'll have 72 virgins before i die,1 +62398.png,this is me tryna look cool after learning how to shoot from the movies,0 +16904.png,than nasty i'd rather be deplorable,0 +96345.png,"these atheist fools what do you mean ""evidence""? i gave you the bible verse """,1 +35279.png,when you convert your dishwasher into a weed eater,1 +85764.png,one small step for man one large step for mankind,0 +23751.png,porn casting or terrorist recruitment? -yes i can blow,1 +47265.png,andy's coming,1 +02751.png,just admit it white america was better,0 +48132.png,black friday deal buy one get one free toaster,1 +95260.png,what's black and screams harvey price answering an iron,1 +13074.png,when your dive instructor starts yelling in arabic,0 +59167.png,"i'm not racist, but... racist memes are allowed, right?",0 +19672.png,got any more dumb white people,1 +96802.png,did you know 100% of the people who stay in their own countries don't get detained and separated from their children at the border,1 +16348.png,the same enemy. we all have by the same people my people were exploited by the same people my land was stolen my people was stolen by the same people,1 +94107.png,because even other planets need crime,1 +72839.png,"im not always hooked on a feeling but when i am, im high on believing",0 +54617.png,"girlfriends, let me tell you what i saw on amazon",0 +54093.png,when you call the avengers and they send the one from wakanda,0 +42850.png,keep it legal. keep it affordable !,0 +74265.png,"it's taekwondo, not taekwondon't",0 +63547.png,i'm down.. ...with that,1 diff --git a/demo_data_generator.py b/demo_data_generator.py index f42ad0d6f19778ae7a2ecd9d7ce6fc64e8254323..43656edbf5026c74fb7b269a1d6aba5fbd87e1f3 100644 --- a/demo_data_generator.py +++ b/demo_data_generator.py @@ -3,10 +3,10 @@ from PIL import Image import PIL image_path = '/Users/amansolanki/datasets/hateful-memes-images/' -image_save_path = '/Users/amansolanki/PycharmProjects/hateful-memes-challenge/demo/demo_data/images/' +image_save_path = '/Users/amansolanki/hateful-memes/images/' test_seen_original = pd.read_csv('/Users/amansolanki/PycharmProjects/hateful-memes-challenge/data/test_seen.csv') -demo_data = test_seen_original.sample(2, random_state=7) +demo_data = test_seen_original.sample(50, random_state=7) # Save Images for image in demo_data['image_id']: diff --git a/images/02751.png b/images/02751.png new file mode 100644 index 0000000000000000000000000000000000000000..1d19a927910f839a9568765849875d5e77bc62ad Binary files /dev/null and b/images/02751.png differ diff --git a/images/02846.png b/images/02846.png new file mode 100644 index 0000000000000000000000000000000000000000..8bf5884cbf85f1c679867aeca51a6f7ef23ca2cd Binary files /dev/null and b/images/02846.png differ diff --git a/images/06752.png b/images/06752.png new file mode 100644 index 0000000000000000000000000000000000000000..2a5eb0c44b694af1ed76d012376a840b7210983b Binary files /dev/null and b/images/06752.png differ diff --git a/images/09638.png b/images/09638.png new file mode 100644 index 0000000000000000000000000000000000000000..0dbe803817af09fcb474610f0cf2ec779f858b20 Binary files /dev/null and b/images/09638.png differ diff --git a/images/13069.png b/images/13069.png new file mode 100644 index 0000000000000000000000000000000000000000..6950781a3d89b14f3cb6d604e978c5e7014c3250 Binary files /dev/null and b/images/13069.png differ diff --git a/images/13074.png b/images/13074.png new file mode 100644 index 0000000000000000000000000000000000000000..1ce7f52be2c137ae6949f0691fad3afe6a41f84a Binary files /dev/null and b/images/13074.png differ diff --git a/images/13726.png b/images/13726.png new file mode 100644 index 0000000000000000000000000000000000000000..f7749ac77d4ecc417ce9166978b101d355432cd1 Binary files /dev/null and b/images/13726.png differ diff --git a/images/13874.png b/images/13874.png new file mode 100644 index 0000000000000000000000000000000000000000..7cfbc45f6c403491a3776058bbd61518fc388c15 Binary files /dev/null and b/images/13874.png differ diff --git a/images/16348.png b/images/16348.png new file mode 100644 index 0000000000000000000000000000000000000000..587e5b93c646f90a84c70bd7aa8b69e131108def Binary files /dev/null and b/images/16348.png differ diff --git a/images/16827.png b/images/16827.png new file mode 100644 index 0000000000000000000000000000000000000000..0eb058f82bacccb8d52d7aebc7946b69acb5a84c Binary files /dev/null and b/images/16827.png differ diff --git a/images/16904.png b/images/16904.png new file mode 100644 index 0000000000000000000000000000000000000000..fa6b6b5222c47b62eaec85a146026921eeed2c47 Binary files /dev/null and b/images/16904.png differ diff --git a/images/17209.png b/images/17209.png new file mode 100644 index 0000000000000000000000000000000000000000..b683f8750e1615b3aacf1b052135422887c45ee1 Binary files /dev/null and b/images/17209.png differ diff --git a/images/19672.png b/images/19672.png new file mode 100644 index 0000000000000000000000000000000000000000..0a4e1f927e04b8a5c918e23879e75cd439345b1f Binary files /dev/null and b/images/19672.png differ diff --git a/images/21386.png b/images/21386.png new file mode 100644 index 0000000000000000000000000000000000000000..26d5f90646032fc2ea5b0859bde62faf1959baa5 Binary files /dev/null and b/images/21386.png differ diff --git a/images/23047.png b/images/23047.png new file mode 100644 index 0000000000000000000000000000000000000000..6951b5b0abdf85a8ee3c6dddab842aa47fcef85b Binary files /dev/null and b/images/23047.png differ diff --git a/images/23751.png b/images/23751.png new file mode 100644 index 0000000000000000000000000000000000000000..9a2b45ac9be665b6947797e58820281e9485cd6a Binary files /dev/null and b/images/23751.png differ diff --git a/images/26891.png b/images/26891.png new file mode 100644 index 0000000000000000000000000000000000000000..e2150ad780d1d72f1367f186f9250ec499743850 Binary files /dev/null and b/images/26891.png differ diff --git a/images/35279.png b/images/35279.png new file mode 100644 index 0000000000000000000000000000000000000000..b39cd08c6bc7dbc554a821096ad8500ca115dd34 Binary files /dev/null and b/images/35279.png differ diff --git a/images/40218.png b/images/40218.png new file mode 100644 index 0000000000000000000000000000000000000000..72812816323248b475aad082ea0fa6e5de4bf408 Binary files /dev/null and b/images/40218.png differ diff --git a/images/42850.png b/images/42850.png new file mode 100644 index 0000000000000000000000000000000000000000..69a1d8c553cedd7d648c732ae5d2c0788431c5a8 Binary files /dev/null and b/images/42850.png differ diff --git a/images/47265.png b/images/47265.png new file mode 100644 index 0000000000000000000000000000000000000000..75179dfdefb5e76783b44930d4797cd94d62a6c9 Binary files /dev/null and b/images/47265.png differ diff --git a/images/48132.png b/images/48132.png new file mode 100644 index 0000000000000000000000000000000000000000..a0f63c805289d89e61bc09a5e63e243ec69c4705 Binary files /dev/null and b/images/48132.png differ diff --git a/images/48326.png b/images/48326.png new file mode 100644 index 0000000000000000000000000000000000000000..e363d1ba77b83b24178e923d67c84a1cd8a66937 Binary files /dev/null and b/images/48326.png differ diff --git a/48539.png b/images/48539.png similarity index 100% rename from 48539.png rename to images/48539.png diff --git a/images/53467.png b/images/53467.png new file mode 100644 index 0000000000000000000000000000000000000000..db0deed601ae50593e3e8c3cd38782b7eb8d8694 Binary files /dev/null and b/images/53467.png differ diff --git a/images/54093.png b/images/54093.png new file mode 100644 index 0000000000000000000000000000000000000000..d8085c0f6428887fc8a782e8860d4b6fe57d2a15 Binary files /dev/null and b/images/54093.png differ diff --git a/images/54617.png b/images/54617.png new file mode 100644 index 0000000000000000000000000000000000000000..71dd729584cefa3bbde93ca9d6a05aa1f52c735b Binary files /dev/null and b/images/54617.png differ diff --git a/images/57908.png b/images/57908.png new file mode 100644 index 0000000000000000000000000000000000000000..21fa257d21666fb7c22aab06277c1f0dff97d846 Binary files /dev/null and b/images/57908.png differ diff --git a/images/59167.png b/images/59167.png new file mode 100644 index 0000000000000000000000000000000000000000..0bf6c3c501542419d954d0aa0b0f5ae2d4e5a0e2 Binary files /dev/null and b/images/59167.png differ diff --git a/images/62398.png b/images/62398.png new file mode 100644 index 0000000000000000000000000000000000000000..4e5a9a5e76704e7c969dfceca820ff5b8a7c9f64 Binary files /dev/null and b/images/62398.png differ diff --git a/images/63097.png b/images/63097.png new file mode 100644 index 0000000000000000000000000000000000000000..cc1b9b4387631eecb43ed3cceb3bfd20b4c6ae39 Binary files /dev/null and b/images/63097.png differ diff --git a/images/63547.png b/images/63547.png new file mode 100644 index 0000000000000000000000000000000000000000..e7f7a7c4e657fc30c69c4b54cfebd81090f45263 Binary files /dev/null and b/images/63547.png differ diff --git a/64038.png b/images/64038.png similarity index 100% rename from 64038.png rename to images/64038.png diff --git a/images/65297.png b/images/65297.png new file mode 100644 index 0000000000000000000000000000000000000000..117bb5c6b2fcdbbb9732235214f808ecbdc85747 Binary files /dev/null and b/images/65297.png differ diff --git a/images/72450.png b/images/72450.png new file mode 100644 index 0000000000000000000000000000000000000000..41a54e20e10cd4b8b761b18ed331876c3ac4c430 Binary files /dev/null and b/images/72450.png differ diff --git a/images/72839.png b/images/72839.png new file mode 100644 index 0000000000000000000000000000000000000000..2c2a0055e9fd52d2c7901b7dfe9f82bb2247336e Binary files /dev/null and b/images/72839.png differ diff --git a/images/74259.png b/images/74259.png new file mode 100644 index 0000000000000000000000000000000000000000..233fceac24e3132e27be71c3b283320a47ab9411 Binary files /dev/null and b/images/74259.png differ diff --git a/images/74265.png b/images/74265.png new file mode 100644 index 0000000000000000000000000000000000000000..b2f557ae67bb86e37a84a486433cbe9b4f3069fe Binary files /dev/null and b/images/74265.png differ diff --git a/images/74621.png b/images/74621.png new file mode 100644 index 0000000000000000000000000000000000000000..f15a541ac4e4d8c2f2490679fae79cdaa4785f1c Binary files /dev/null and b/images/74621.png differ diff --git a/images/76180.png b/images/76180.png new file mode 100644 index 0000000000000000000000000000000000000000..cc29a7abf506b18c085ed09f3f85c99fc11bb3c5 Binary files /dev/null and b/images/76180.png differ diff --git a/images/84759.png b/images/84759.png new file mode 100644 index 0000000000000000000000000000000000000000..3151f2f401993766368bde0c6453e302b12af9b2 Binary files /dev/null and b/images/84759.png differ diff --git a/images/85764.png b/images/85764.png new file mode 100644 index 0000000000000000000000000000000000000000..32516f1971d9be6aea689c3e76487eac14f588e0 Binary files /dev/null and b/images/85764.png differ diff --git a/images/89136.png b/images/89136.png new file mode 100644 index 0000000000000000000000000000000000000000..82644440d4175fd1f3d7d0a92a216df2c66ba4fb Binary files /dev/null and b/images/89136.png differ diff --git a/images/94107.png b/images/94107.png new file mode 100644 index 0000000000000000000000000000000000000000..389a8a61fb5d6ed91daeaa19c7a6fe7efd21e50e Binary files /dev/null and b/images/94107.png differ diff --git a/images/94380.png b/images/94380.png new file mode 100644 index 0000000000000000000000000000000000000000..1ef3f7eb202cf77739bebe45b2d39470fb73a6de Binary files /dev/null and b/images/94380.png differ diff --git a/images/95260.png b/images/95260.png new file mode 100644 index 0000000000000000000000000000000000000000..83e5ffd0eb036aee0eaca00fa1ee7c9ac43409c7 Binary files /dev/null and b/images/95260.png differ diff --git a/images/95402.png b/images/95402.png new file mode 100644 index 0000000000000000000000000000000000000000..c420748de20f4ee29c1a51bd1c7edf391a56a508 Binary files /dev/null and b/images/95402.png differ diff --git a/images/96185.png b/images/96185.png new file mode 100644 index 0000000000000000000000000000000000000000..340718ab5247e7d9131e9442ba7ff66fdd1f21ec Binary files /dev/null and b/images/96185.png differ diff --git a/images/96345.png b/images/96345.png new file mode 100644 index 0000000000000000000000000000000000000000..4de79aa1c10ae59fcfe6267acea3cc20abe9a3c1 Binary files /dev/null and b/images/96345.png differ diff --git a/images/96802.png b/images/96802.png new file mode 100644 index 0000000000000000000000000000000000000000..81498dad4f4b840c5900285881eda7386cd20958 Binary files /dev/null and b/images/96802.png differ