We tolk a lot about new trend writting code with help AI. If you look into it, it will become obviously: AI capable of replacing small parts of modern code in companies.
Today AI much more effective in areas: detecting objects, words bots and computer vision.
On picture not very hard neural network, which based on a series of convolutions and pulls. This particular design names UNet-Segmentation.
df = pd.read_csv('data/train_masks.csv') train_df = df[:4000] val_df = df[4000:] img_name, mask_rle = train_df.iloc[4] img = cv2.imread('data/train/{}'.format(img_name)) mask = rle_decode(mask_rle)
conv_1_1 = Conv2D(32, (3, 3), padding='same')(inp) conv_1_1 = Activation('relu')(conv_1_1) conv_1_2 = Conv2D(32, (3, 3), padding='same')(conv_1_1) conv_1_2 = Activation('relu')(conv_1_2) pool_1 = MaxPooling2D(2)(conv_1_2)
model.fit_generator(keras_generator(train_df, batch_size), steps_per_epoch=100, epochs=100, verbose=1, callbacks=callbacks, validation_data=keras_generator(val_df, batch_size), validation_steps=50, class_weight=None, max_queue_size=10, workers=1, use_multiprocessing=False, shuffle=True, initial_epoch=0)
The above is the detailed content of If trying write AI. For more information, please follow other related articles on the PHP Chinese website!