-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor code #7
base: master
Are you sure you want to change the base?
Conversation
config.py
Outdated
@@ -19,13 +19,16 @@ | |||
BATCH_SIZE = 32 | |||
NUM_CLASSES = 4 | |||
|
|||
# epochs | |||
EPOCHS=50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
epoch should be lied in above group.
fit_model.py
Outdated
nb_samples = validate_df.shape[0] | ||
predict = model.predict(validation_generator, steps=np.ceil(nb_samples/BATCH_SIZE)) | ||
validate_df['pred'] = np.argmax(predict, axis=-1) | ||
nb_samples = test_df.shape[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments here maybe better
|
||
# const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should explain its use not its type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are constant values so we just comment to understand what it is. their usage will be known where they are used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when we use uppercase word and underscore between, it is constant, so you dont have to comment like that
generator.py
Outdated
validation_datagen = ImageDataGenerator(rescale=1./255) | ||
validation_generator = validation_datagen.flow_from_dataframe( | ||
validate_df, | ||
test_datagen = ImageDataGenerator(rescale=1./255) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments here may be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like why do you choose 1./255 ?
open_cam.py
Outdated
keras_model = load_model('model.h5') | ||
# facenet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments its use not its name dude :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) no here is comment for definition not where it take action. only declaration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you can remove this comment, because it's not nescessary
keras_model = load_model('model.h5') | ||
# facenet | ||
facenet = cv2.dnn.readNetFromCaffe(CAFFE_PROTO_FILE, MODEL_FILE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example, load predictive model from prototype and trained model file caffenet which is for detecting human face
facenet = cv2.dnn.readNetFromCaffe(CAFFE_PROTO_FILE, MODEL_FILE) | ||
|
||
# labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe explains about the color and structure is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here can easily understand sir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh really, so why you have to name variable is label ? (51, 153, 255) -> color ?
|
||
# pca model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is not running right ?
you can remove it
change the README.md file also, for example, python3 open_cam.py is no way work because there is no open_cam.py file in current directory |
@sherlockvn I have resolved all comments. please take a look at my PR again. |
No description provided.