amansolanki commited on
Commit
9936396
1 Parent(s): f09f8fd

new demo data

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/csv-plugin.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CsvFileAttributes">
4
+ <option name="attributeMap">
5
+ <map>
6
+ <entry key="/demo_data.csv">
7
+ <value>
8
+ <Attribute>
9
+ <option name="separator" value="," />
10
+ </Attribute>
11
+ </value>
12
+ </entry>
13
+ </map>
14
+ </option>
15
+ </component>
16
+ </project>
.idea/hateful-memes.iml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
.idea/inspectionProfiles/Project_Default.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
5
+ <Languages>
6
+ <language minSize="328" name="Python" />
7
+ </Languages>
8
+ </inspection_tool>
9
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
10
+ <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
11
+ <option name="ignoredPackages">
12
+ <value>
13
+ <list size="12">
14
+ <item index="0" class="java.lang.String" itemvalue="tensorflow" />
15
+ <item index="1" class="java.lang.String" itemvalue="pandas" />
16
+ <item index="2" class="java.lang.String" itemvalue="scipy" />
17
+ <item index="3" class="java.lang.String" itemvalue="tensorboard" />
18
+ <item index="4" class="java.lang.String" itemvalue="scikit-learn" />
19
+ <item index="5" class="java.lang.String" itemvalue="nltk" />
20
+ <item index="6" class="java.lang.String" itemvalue="matplotlib" />
21
+ <item index="7" class="java.lang.String" itemvalue="progressbar" />
22
+ <item index="8" class="java.lang.String" itemvalue="pillow" />
23
+ <item index="9" class="java.lang.String" itemvalue="keras" />
24
+ <item index="10" class="java.lang.String" itemvalue="keras-preprocessing" />
25
+ <item index="11" class="java.lang.String" itemvalue="lightgbm" />
26
+ </list>
27
+ </value>
28
+ </option>
29
+ </inspection_tool>
30
+ <inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
31
+ <option name="ignoredErrors">
32
+ <list>
33
+ <option value="N806" />
34
+ </list>
35
+ </option>
36
+ </inspection_tool>
37
+ </profile>
38
+ </component>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/hateful-memes.iml" filepath="$PROJECT_DIR$/.idea/hateful-memes.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
app.py CHANGED
@@ -6,7 +6,7 @@ import pickle
6
  from utils import get_image_arrays, get_image_predictions, show_image
7
 
8
  st.title('Hateful Memes Classification')
9
- image_path = './'
10
  demo_data_file = 'demo_data.csv'
11
  demo_data = pd.read_csv('demo_data.csv')
12
  TFLITE_FILE_PATH = 'image_model.tflite'
 
6
  from utils import get_image_arrays, get_image_predictions, show_image
7
 
8
  st.title('Hateful Memes Classification')
9
+ image_path = './images'
10
  demo_data_file = 'demo_data.csv'
11
  demo_data = pd.read_csv('demo_data.csv')
12
  TFLITE_FILE_PATH = 'image_model.tflite'
demo_data.csv CHANGED
@@ -1,3 +1,51 @@
1
  image_id,text,label
2
  48539.png,"the woman you met who admits she's wrong, apologizes and changes her ways",0
3
  64038.png,riding a horse backwards,0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  image_id,text,label
2
  48539.png,"the woman you met who admits she's wrong, apologizes and changes her ways",0
3
  64038.png,riding a horse backwards,0
4
+ 53467.png,how you look when youre black and you celebrate the 4th of july,0
5
+ 65297.png,when your little bomber brings home his first girlfriend,0
6
+ 26891.png,today we're making vegetable soup! the most disturbing thing i've seen all day.,1
7
+ 02846.png,the before image that not many people have seen,0
8
+ 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
9
+ 09638.png,thanksgiving in china,1
10
+ 40218.png,some habits are hard to stop,0
11
+ 21386.png,the victoria's secret angels across america tour,0
12
+ 17209.png,stop saying my religion is violent.. i will kill you in the or name of my religion,1
13
+ 13874.png,ban the burka you must be fucking joking,0
14
+ 13069.png,replaced by misunderstood girlfriend doesn't get jealous,0
15
+ 48326.png,like i said. i'm an aries!,0
16
+ 16827.png,partial arts,0
17
+ 57908.png,wow. a muscle car am i supposed to be impressed by that?,0
18
+ 94380.png,that look when you high as fuck on dem chromosomes,1
19
+ 89136.png,this was fake news a lot of people don't realise it. please do your research,0
20
+ 95402.png,to all the high school grads... congratulations on getting through the easiest part of life,0
21
+ 74621.png,"""what kind of question is that? of course i fuck goat. next question...""",0
22
+ 23047.png,i like to play outside,0
23
+ 63097.png,like and share if you want loretta lynch investigated,0
24
+ 13726.png,"democrats giving rights to those who have no right to be here, while taking rights from those who do",0
25
+ 72450.png,the closest some of us will ever get to heaven,1
26
+ 84759.png,what if tornadoes are actually created secretly by the government to destroy white trash people living in trailer homes,1
27
+ 76180.png,how to get stoned without smoking weed,0
28
+ 96185.png,"i hate the chinese, black, white, mexican people so who do i like? therein lies the problem",1
29
+ 74259.png,i'll have 72 virgins when i die i'll have 72 virgins before i die,1
30
+ 62398.png,this is me tryna look cool after learning how to shoot from the movies,0
31
+ 16904.png,than nasty i'd rather be deplorable,0
32
+ 96345.png,"these atheist fools what do you mean ""evidence""? i gave you the bible verse """,1
33
+ 35279.png,when you convert your dishwasher into a weed eater,1
34
+ 85764.png,one small step for man one large step for mankind,0
35
+ 23751.png,porn casting or terrorist recruitment? -yes i can blow,1
36
+ 47265.png,andy's coming,1
37
+ 02751.png,just admit it white america was better,0
38
+ 48132.png,black friday deal buy one get one free toaster,1
39
+ 95260.png,what's black and screams harvey price answering an iron,1
40
+ 13074.png,when your dive instructor starts yelling in arabic,0
41
+ 59167.png,"i'm not racist, but... racist memes are allowed, right?",0
42
+ 19672.png,got any more dumb white people,1
43
+ 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
44
+ 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
45
+ 94107.png,because even other planets need crime,1
46
+ 72839.png,"im not always hooked on a feeling but when i am, im high on believing",0
47
+ 54617.png,"girlfriends, let me tell you what i saw on amazon",0
48
+ 54093.png,when you call the avengers and they send the one from wakanda,0
49
+ 42850.png,keep it legal. keep it affordable !,0
50
+ 74265.png,"it's taekwondo, not taekwondon't",0
51
+ 63547.png,i'm down.. ...with that,1
demo_data_generator.py CHANGED
@@ -3,10 +3,10 @@ from PIL import Image
3
  import PIL
4
 
5
  image_path = '/Users/amansolanki/datasets/hateful-memes-images/'
6
- image_save_path = '/Users/amansolanki/PycharmProjects/hateful-memes-challenge/demo/demo_data/images/'
7
  test_seen_original = pd.read_csv('/Users/amansolanki/PycharmProjects/hateful-memes-challenge/data/test_seen.csv')
8
 
9
- demo_data = test_seen_original.sample(2, random_state=7)
10
 
11
  # Save Images
12
  for image in demo_data['image_id']:
 
3
  import PIL
4
 
5
  image_path = '/Users/amansolanki/datasets/hateful-memes-images/'
6
+ image_save_path = '/Users/amansolanki/hateful-memes/images/'
7
  test_seen_original = pd.read_csv('/Users/amansolanki/PycharmProjects/hateful-memes-challenge/data/test_seen.csv')
8
 
9
+ demo_data = test_seen_original.sample(50, random_state=7)
10
 
11
  # Save Images
12
  for image in demo_data['image_id']:
images/02751.png ADDED
images/02846.png ADDED
images/06752.png ADDED
images/09638.png ADDED
images/13069.png ADDED
images/13074.png ADDED
images/13726.png ADDED
images/13874.png ADDED
images/16348.png ADDED
images/16827.png ADDED
images/16904.png ADDED
images/17209.png ADDED
images/19672.png ADDED
images/21386.png ADDED
images/23047.png ADDED
images/23751.png ADDED
images/26891.png ADDED
images/35279.png ADDED
images/40218.png ADDED
images/42850.png ADDED
images/47265.png ADDED
images/48132.png ADDED
images/48326.png ADDED
48539.png → images/48539.png RENAMED
File without changes
images/53467.png ADDED
images/54093.png ADDED
images/54617.png ADDED
images/57908.png ADDED
images/59167.png ADDED
images/62398.png ADDED
images/63097.png ADDED
images/63547.png ADDED
64038.png → images/64038.png RENAMED
File without changes
images/65297.png ADDED
images/72450.png ADDED
images/72839.png ADDED
images/74259.png ADDED
images/74265.png ADDED
images/74621.png ADDED
images/76180.png ADDED