Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Refactor code #7

wants to merge 10 commits into from

Conversation

huythangphan
Copy link
Collaborator

No description provided.

@huythangphan huythangphan self-assigned this Dec 7, 2021
config.py Outdated
@@ -19,13 +19,16 @@
BATCH_SIZE = 32
NUM_CLASSES = 4

# epochs
EPOCHS=50
Copy link
Owner

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.

dataframe.py Show resolved Hide resolved
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]
Copy link
Owner

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
Copy link
Owner

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

Copy link
Collaborator Author

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

Copy link
Owner

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)
Copy link
Owner

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

Copy link
Owner

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
Copy link
Owner

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 :)

Copy link
Collaborator Author

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

Copy link
Owner

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)
Copy link
Owner

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
Copy link
Owner

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

Copy link
Collaborator Author

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

Copy link
Owner

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
Copy link
Owner

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

@sherlockvn
Copy link
Owner

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

@huythangphan
Copy link
Collaborator Author

@sherlockvn I have resolved all comments. please take a look at my PR again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants