Creating an opto isolator board for Raspberry Pi
First of all, you probably don't need the PIC 817 at all. There is a transistor or "something" at the input of the relay board which keeps the Pi out of harm. Unless you have some freak accident.

That said, the PIC 817 is wired wrong. As it is know the collector will short he Pi 5V to ground when it activates. You need a pullup resistor instead of the straight wire to the diode. Note that your logic will be "active low" by using the optocoupler. A "1" on the GPIO will activate the optocoupler which will pull the relay boards CH1/2 low and deactivate the relay.

The GPIO on the Pi will probably also risk being fried by your PIC 817 diode. Have you looked up what the maxium allowable Pi GPIO current is? I think it is pretty low.

You also need to check what current the relay needs. The hk3ff-dc5v-shg relays seem to have a coil resistance of 70 Ohm. That would be approx. 0.14A on the 5V regulator if both relays are drawn. Is that OK?