Skip to content

Commit 865370c

Browse files
author
sbriley
authored
Update README.md
1 parent 803d0e1 commit 865370c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,20 @@ Now you're ready to go!
108108
You can find example code to run each of the current neural net classes in [examples](examples). The best place to start is the [FERModel example](examples/fermodel_example.py). Here is a listing of that code:
109109

110110
```python
111-
import sys
112-
sys.path.append('../')
113-
from fermodel import FERModel
111+
from EmoPy.src.fermodel import FERModel
112+
from pkg_resources import resource_filename
114113

115114
target_emotions = ['calm', 'anger', 'happiness']
116115
model = FERModel(target_emotions, verbose=True)
117116

118117
print('Predicting on happy image...')
119-
model.predict('image_data/sample_happy_image.png')
118+
model.predict(resource_filename('EmoPy.examples','image_data/sample_happy_image.png'))
119+
120+
print('Predicting on disgust image...')
121+
model.predict(resource_filename('EmoPy.examples','image_data/sample_disgust_image.png'))
122+
123+
print('Predicting on anger image...')
124+
model.predict(resource_filename('EmoPy.examples','image_data/sample_anger_image2.png'))
120125
```
121126

122127
The code above loads a pre-trained model and then predicts an emotion on a sample image. As you can see, all you have to supply with this example is a set of target emotions and a sample image.

0 commit comments

Comments
 (0)